bitnami django, solution to restarting service?

柔情痞子 提交于 2019-12-25 02:21:47

问题


Hey I use installed bitnami django 1.3.0,

but whenever I add changes to urls.py or views.py in my system due to some error. The error won't disappear after refresh.

I have to restart my bitnami Service, "stop" and then "start" it, which is time consuming, I feel like I'm coding C# apps in visual studio. Sometimes even that doesn't work, I have to sometimes restart my computer and then I suddenly realize "oh wow, the error is solved now!"

Any solution to this? Why does everything require a runserver / restart?


回答1:


You can use Apache for deploy your application in production but use the Django server for development. You will need to configure your application for being served by apache later (modifying the settings.py and the apache configuration file) but during the development you won't need to restart the server for every change.




回答2:


Everything requires a restart because of the way that the python process operates. It does not reload the file when it's changed (outside of runserver..which is an anomaly, and just there for convenience)

Python execution isn't like PHP execution in that way, and your code isn't dynamically loaded on every page refresh, it's loaded on every server restart.

Hope that helps.



来源:https://stackoverflow.com/questions/7851429/bitnami-django-solution-to-restarting-service

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