Why must I restart fastcgi process for Django? [du

2019-08-30 09:26发布

问题:

Possible Duplicate:
Django, Nginx, FastCGI caching problem when I change code

Currently I use Nginx + fastcgi to run Django applications. After I change the source code of a Python file in a web application, I always see the old version of application from browser. It seems that it doesn't include my changes. Only after I restart the fastcgi process of Django, my changes take effect. Is there a way to make my changes take effect immediately without restart any processes? (I run Nginx and Python in Windows for debugging.)

回答1:

New changes aren't reflected until after restart because your code is loaded into memory when the server is started. The only reason why the django development environment doesn't suffer this is because it is constantly watching the filesystem for changes and auto-reloads when it detects a change.

There are some solutions discussed here and here.