How to automatically reload Django when files change?

后端 未结 4 2012
醉酒成梦
醉酒成梦 2020-12-14 07:57

How to automatically monitor .py, .js and other source code files to restart a Django (or any other for that matter) application and refresh the browser when the source chan

4条回答
  •  醉梦人生
    2020-12-14 08:18

    Frustrated with all the explicit refreshes, I created a browser extension, for both Firefox and Chrome, to automate this. The extension works with a Django app that you add to your app list in INSTALLED_APPS. You can find out more at the github repo.

    Though the repo has entire source code, the extensions are also available in the respective web store. Just search for 'Django Auto Refresh'. With these, you just need to copy the app into our project's folder and include it via INSTALLED_APPS. I wanted to add a pip setup script, but haven't found the time to do it.

    HTH. Apologies if this sounds like self promotion.

提交回复
热议问题