Flask application with mod_wsgi not reloading when I touch wsgi script

允我心安 提交于 2019-12-24 03:53:07

问题


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>

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?


回答1:


We have resolved this question in the comments above, but for the benefit of others, here is the solution to this problem:

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,



来源:https://stackoverflow.com/questions/27871948/flask-application-with-mod-wsgi-not-reloading-when-i-touch-wsgi-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!