bitnami django,重新启动服务的解决方案?

发布于 2024-12-11 08:47:44 字数 267 浏览 1 评论 0原文

嘿,我使用已安装的 bitnami django 1.3.0,

但是每当我由于某些错误而在系统中添加对 urls.py 或views.py 的更改时。刷新后错误不会消失。

我必须重新启动我的 bitnami 服务,“停止”然后“启动”它,这很耗时,我感觉我正在 Visual Studio 中编写 C# 应用程序。有时即使这样也不起作用,有时我必须重新启动计算机,然后我突然意识到“哇哦,错误现在解决了!”

有什么办法解决这个问题吗?为什么一切都需要运行服务器/重新启动?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青春如此纠结 2024-12-18 08:47:44

您可以使用 Apache 在生产中部署应用程序,但使用 Django 服务器进行开发。您需要配置您的应用程序以便稍后由 apache 提供服务(修改 settings.py 和 apache 配置文件),但在开发过程中您不需要为每次更改都重新启动服务器。

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.

顾铮苏瑾 2024-12-18 08:47:44

由于 python 进程的运行方式,一切都需要重新启动。当文件发生更改时,它不会重新加载文件(在 runserver 之外......这是一个异常,只是为了方便起见)

Python 执行与 PHP 执行不同,并且您的代码不会在每次页面刷新时动态加载,它会在每次服务器重新启动时加载。

希望有帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文