Restart server from bash console

大憨熊 提交于 2020-01-02 07:16:42

问题


Is there any way to restart the web server from within the bash console given in the browser for PythonAnywhere? I have searched google for a while and have not found anything relevant.


回答1:


There is a file for each of your web apps in /var/www. The naming of the file should make it obvious which file applies to which web app.

Type

touch /var/www/<filename>

(where <filename> is the name of the file that is for the web app you want to restart) and server will notice that the modified date of the file has changed and restart your app.




回答2:


As quoted by harry, one of the people working at PythonAnywhere on the PA forum https://www.pythonanywhere.com/forums/topic/89/#id_post_4289

touching the file at /var/www/you-domain-wsgi.py will reload your web app workers, so that will pick up on any code changes you've made, but be warned that it doesn't do the other stuff which the button does, in particular, it won't pick up any new static files directory mappings you've made.

To perform a full reload, you can use this script on github.

git clone https://github.com/ayys/pareload.git



来源:https://stackoverflow.com/questions/12434327/restart-server-from-bash-console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!