Django, Nginx, FastCGI caching problem when I change code

前端 未结 1 1510
北海茫月
北海茫月 2021-01-14 09:24

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 c

相关标签:
1条回答
  • 2021-01-14 09:44

    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 讨论(0)
提交回复
热议问题