Django + apache & mod_wsgi: having to restart apache after changes

别说谁变了你拦得住时间么 提交于 2019-11-28 20:20:01

My suggestion is that you run the application in daemon mode. This way you won't be required to restart apache, just touch my_handler.wsgi and the daemon will know to restart the app. The apache httpd will not be only yours (in production) so it is fair not to restart it on every update.

No changes require you to RESTART. You simply need to reload using "sudo /etc/init.d/apache2 reload". Which I have aliased in my bashrc to 'a2reload'.

function a2reload (){
sudo /etc/init.d/apache2 reload
}

Apache loads Django environment when starting and keep running it even when source is changed.

I suggest you to use Django 'runserver' (which automatically restarts on changes) in heavy development sessions, unless you need some Apache-specific features (such as multi-thread).

Note also that changes in templates do not require the restart of the web server.

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