Does uWSGI need to be restarted when Django code changes?

前端 未结 1 1740
走了就别回头了
走了就别回头了 2020-12-18 23:47

I\'m working on a Django webapp that\'s running under nginx and uWSGI. When I deploy new Django code (e.g., settings.py), do I need to restart uWSGI? If so, why?

B

相关标签:
1条回答
  • 2020-12-19 00:12

    Yes, you need to restart the uWSGI process.

    Python keeps the compiled code in memory so it won't get re-read until the process restarts. The django development server (manage.py runserver) actively monitors files for changes, but that won't happen by default with other servers. If you want to enable automatic reloading in uWSGI, the touch-reload and py-auto-reload uWSGI arguments might help.

    0 讨论(0)
提交回复
热议问题