문제

I've been wondering if I can enable Auto Reload on a PythonAnywhere-based Django web-server. Right now, when I make any changes to my models or views, I have to reload the complete web-app for changes to be visible.

I would like my changes to be seen immediately. I have no clue if I can disable the --noreload flag that is probably set, or that I can modify it somewhere, but it would be really convenient. (Sometimes, I forget clicking 'Reload Web Server', and I bang my head wondering where the problem is)

Many thanks,

Mats

도움이 되었습니까?

해결책

Because PythonAnywhere does not use the django test server this can not be done simply.

The file /var/www/wsgi.py is currently set to reload the web server on any modification. Having that file open in a browser tab and hitting save on it would result in a slightly faster server reload.

Another option is to use a bookmarklet, which you could add to your bookmarks toolbar:

https://www.pythonanywhere.com/help/#id_reload_webapp_bookmarklet

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top