当我触摸wsgi脚本时,不会重新加载带有mod_wsgi的烧瓶应用程序 [英] Flask application with mod_wsgi not reloading when I touch wsgi script
问题描述
我正在使用mod_wsgi用apache运行flask应用程序.在更改python代码后,我在重新加载应用程序时遇到了麻烦,因此我通读了 mod_wsgi Wiki 中有关重新加载源代码的信息.我运行了脚本以确认我以守护程序模式运行,并且.conf VirtualHost的设置如下:
I am running a flask application with apache using mod_wsgi. I was having trouble reloading the application after making a change to the python code so I read through the mod_wsgi wiki on reloading source code. I ran the script to confirm that I am running in Daemon mode, and my .conf VirtualHost is setup as follows:
<VirtualHost *:80>
ServerAdmin admin@succor.co
ServerName dev.succor.co
DocumentRoot /var/www/study_buddy_dev/study_buddy
WSGIScriptAlias / /var/www/study_buddy_dev/study_buddy/app.wsgi
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel info
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/study_buddy_dev/study_buddy/>
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/htpasswd/.htpasswd"
Require valid-user
WSGIScriptReloading On
Order deny,allow
Allow from all
</Directory>
WSGIDaemonProcess succor.dev processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup succor.dev
</VirtualHost>
但是当我运行~$ sudo touch app.wsgi
时,我的应用程序没有任何变化,我完全不知道为什么.谁能告诉我我在这里做错了什么?
But when I run ~$ sudo touch app.wsgi
nothing changes in my application and I am completely at a loss as to why. Can anyone shed some light on what I am doing wrong here?
推荐答案
我们已经在上面的注释中解决了这个问题,但是为了他人的利益,这是解决此问题的方法:
We have resolved this question in the comments above, but for the benefit of others, here is the solution to this problem:
我的猜测是Apache正在运行的Python文件不是您正在编辑的Python文件,您可能安装了两组文件.但这只是一种猜测,可以解释您所看到的行为,
My guess is that the Python files that Apache is running are not the Python files that you are editing, you probably have two sets of files installed. But this is only a guess, one that explains the behavior you are seeing,
这篇关于当我触摸wsgi脚本时,不会重新加载带有mod_wsgi的烧瓶应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!