开发者

Django, Nginx, FastCGI caching problem when I change code

I've installed Django, Nginx and FastCGI on one my servers. This is my development server and I'm having a very difficult time with the caching. Every time when I make a change I have to reboot the whole server to see the actual change. Rebooting Nginx process didn't help eithter.

So it might be Django and/or FastCGI doing the caching. I also looked at the settings.py and there is no caching set on Django开发者_运维知识库.

What's the best way to make sure when I change the page code the caching gets reset automatically? Your help is greatly appreciated.


If it's not manage.py runserver we're talking about, you have to reset your server to see code changes to reload python and your code into memory.

Only the django devlopment server can detect changes and re-boot for you.

If you are saying you have to reboot the machine to update code, then you should look at how to restart your fastcgi process.

http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#stopping-the-fastcgi-daemon
http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#restarting-the-spawned-server

As for the best way? I develop on my local machine so for me a deployment script would ensure I get the latest update from version control and a reboot. Otherwise I just type arestart (a one hand typable bash alias).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜