wsgi 提供的页面不刷新
我最近得到了我的第一个应用程序,可以在 uWSGI 中与 Cherokee 一起使用。我使用了以下代码,取自 uWSGI 文档:
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
yield 'Hello World\n'
页面正确读取 你好世界
。当我将该文本更改为“New Thing”并刷新时,没有任何变化。我忘记了什么?
我尝试过:
- 清除浏览器历史记录和缓存
- 停止和启动切诺基
Edit: To clarify, I change
Hello World
to New Thing
in the Python code. Then I stop Cherokee, refresh, and I obviously see an error message. I restart Cherokee, refresh, and I see Hello World
.I recently got my first app to work in uWSGI with Cherokee. I used the following code taken from the uWSGI docs:
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
yield 'Hello World\n'
The page correctly reads Hello World
. When I change that text to New Thing
and refresh, nothing changes. What am I forgetting?
What I've tried:
- clearing browser history and cache
- stopping and starting Cherokee
Edit: To clarify, I change
Hello World
to New Thing
in the Python code. Then I stop Cherokee, refresh, and I obviously see an error message. I restart Cherokee, refresh, and I see Hello World
.如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,其工作方式是 Cherokee 在后台为您管理一个正在运行的 uwsgi 实例。到目前为止,我注意到并且尚未完成的研究是,如果您关闭 Cherokee,它似乎不会同时关闭正在运行的 uwsgi 实例。
试试这个:
所以你的应用程序代码实际上是通过 uwsgi 运行的,而 Cherokee 更像是一个代理服务器。为了更新应用程序代码,您需要将 HUP 信号发送到 uwsgi,而不是 Cherkee。
这应该会导致 uwsgi 更新到您的应用程序更改,无论切诺基如何。
So the way this works is that Cherokee is managing a running uwsgi instance in the back ground for you. What I've noticed so far, and I've not finished looking at, is that if you shut down Cherokee it doesn't seem to also shut down running uwsgi instances.
Try this:
So your app code is actually run via uwsgi and Cherokee is more like a proxy server. In order to update the app code you need to send the HUP signal to uwsgi, not Cherkee.
That should cause uwsgi to update to your app changes regardless of Cherokee.