Python Django 重启服务器或 httpd
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3742734/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Django restart server or httpd
提问by Rajeev
In django framework,When there are changes in urls.py or model.py or views.py .We would restart httpd.
在 django 框架中,当 urls.py 或 model.py 或 views.py 发生变化时,我们会重新启动 httpd。
But as the documentation says we could restart runserver to get the latest changes.
但正如文档所说,我们可以重新启动 runserver 以获取最新更改。
Which is the best efficient way for doing the above
哪个是执行上述操作的最佳有效方法
采纳答案by juanefren
runserver.py restarts automatically every time you modify any .py file, but when you are using apache you have to restart the proccess manually.
每次修改任何 .py 文件时,runserver.py 都会自动重新启动,但是当您使用 apache 时,您必须手动重新启动进程。
回答by Mad Scientist
runserverrefers to the development server that is distributed with Django. Restarting this one or your httpd are the same thing, in both cases you restart the webserver. If you're using apache, you are not using the development server that is startet by runserver.py.
runserver是指与 Django 一起分发的开发服务器。重新启动这个或你的 httpd 是一回事,在这两种情况下你都重新启动网络服务器。如果您使用的是 apache,则您没有使用由runserver.py.
回答by Maxim Pokrovskii
touch your_project_name.wsgiand save without any change.
It will change data modify and django will automatically reloading code.
touch your_project_name.wsgi并保存而不做任何更改。它将更改数据修改,django 将自动重新加载代码。
回答by Saurabh Chandra Patel
Type fgin terminal to take job front and then type Ctr+cto stop server and then run
键入fg在终端采取的工作前,然后输入Ctr+c到停止服务器,然后运行
Python manage.py runserver

