Django code changes not reflecting on production server

你离开我真会死。 提交于 2019-12-10 03:24:15

问题


I changed a .py file and changes reflected on local dev. server for Django after deleting .pyc. The production server does not even have .pyc for this specific file. Tried touching apache wsgi and restarting apache on prod. server but no luck. Even deleting this .py file makes application work the same. There is memcached installed but I don't have much idea how it caches, there is .git as well and 5 servers are hosting - one main, 4 load balancers.

Regards !


回答1:


Are 100% sure you are looking at the right server you are making the changes to? I know that sounds stupid but, why don't you stop Apache, can you still run the page then? IF you can then you definitely don't have the correct server.

If not, next try reloading Apache (thats different from restarting).

sudo service apache2 reload

If this still does not work then post your Apache setup, if must be looking on the wrong folder to the one your pushing to.




回答2:


You have to restart your server (WSGI, UWSGI or whatever your use on production environment)




回答3:


If you use uwsgi as gateway set touch-reload param in uwsgi settings and you need just

$ touch <your-touch-reload-file>

in console for reflecting on changes

If you use apache with mod_python or mod_wsgi, you have to restart apache for apply changes



来源:https://stackoverflow.com/questions/14770972/django-code-changes-not-reflecting-on-production-server

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