【问题标题】:Nginx + Gunicorn not showing updated version of Django codeNginx + Gunicorn 未显示 Django 代码的更新版本
【发布时间】:2016-03-11 07:45:01
【问题描述】:

我已经正确上传了一个使用 Nginx 和 Gunicorn 和域点的 Django 项目。但是现在当我更新/更改代码时,它仍然向我显示相同的旧消息。我什至试图创建一个错误,但它仍然显示我用来显示用于测试的旧的基于编码的消息。我的settings 在链接中提供。

请指教。

【问题讨论】:

  • 您在进行更改时是否重新启动了 gunicorn?
  • 是的,我确实使用了“sudo service nginx restart”和“sudo service gunicorn restart”。两个服务都重新启动,但结果仍然相同。
  • 运行项目的设置是什么?喜欢python manage.py runservergunicorn manage.py
  • gunicorn project.wsgi:application --bind 127.0.0.1:9500 -w9 -p /tmp/project.pid --daemon。有关完整设置,请参阅我提供的链接。
  • 你的新贵脚本文件的名称是什么?它在哪里?具有exec gunicorn ...的文件。

标签: python django nginx gunicorn


【解决方案1】:

我在 GCP Compute Engine 实例上的 hello world 应用中遇到了同样的问题,其中包含 nginx、gunicorn、supervisor 和 systemd 配置。

It looks like supervisor is not properly restarting the gunicorn

在我的情况下,我通过以下命令解决了这个问题

sudo systemctl restart gunicorn

【讨论】:

    猜你喜欢
    • 2018-01-01
    • 2023-03-13
    • 2016-04-16
    • 2013-03-25
    • 2013-03-01
    • 2019-11-02
    • 1970-01-01
    • 2013-03-28
    • 2018-11-12
    相关资源
    最近更新 更多