简体   繁体   English

我从gunicorn那里得到了错误500,我在Django设置py中设置了Debug = False-Upstart变体

[英]I got error 500 from gunicorn whet i set Debug=False in django settings py - Upstart variant

The problem is identical to this one but I use upstart. 问题与相同,但我使用新贵。 How to modify my upstart conf below to make it work. 如何在下面修改我的新贵conf以使其正常工作。 gunicorn.conf

description "gunicorn"

start on (filesystem)
stop on runlevel [016]

respawn
console log
setuid nobody
setgid nogroup
chdir /home/spadmin/spcrm

exec /home/spadmin/.virtualenvs/crm/bin/python /home/spadmin/spcrm/manage.py run_gunicorn -w 3 -k gevent

Nginx is started via upstart conf from nginx package. Nginx是通过Nginx软件包中的upstart conf启动的。 I can post it if it's relevant. 如果相关,我可以发布。

And from curiosity: is this problem related to timing when starting jobs? 出于好奇:这个问题与开始工作的时间有关吗? The above question provides solution but not explanation. 上述问题提供了解决方案,但没有解释。

Jingo's comment describes the solution to a common problem when running with DEBUG = False. Jingo的评论描述了使用DEBUG = False运行时常见问题的解决方案。 Try that, but also make sure you're checking your gunicorn logs/console. 尝试一下,但还要确保您正在检查您的Gunicorn原木/控制台。 The actual exception should be logged there, and that would let you know whether it's the ALLOWED_HOSTS problem (you would see a SuspiciousOperation exception), or some other issue. 实际的异常应该记录在这里,这将使您知道是ALLOWED_HOSTS问题(您将看到SuspiciousOperation异常)还是其他一些问题。

You may also want to consider adding Sentry to your project (via its Raven client). 您可能还需要考虑将Sentry添加到您的项目中(通过其Raven客户端)。 This will collect log messages and log uncaught exceptions to a very useful web app. 这将收集日志消息并将未捕获的异常记录到一个非常有用的Web应用程序中。 See http://sentry.readthedocs.org/en/latest/ 参见http://sentry.readthedocs.org/en/latest/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我在 Python Django 中打开 DEBUG = False 时出现错误 500 - Error 500 when I turned DEBUG = False in Python Django 调试设置为 False 的已部署 django 应用程序上出现 500 错误 - 500 error on deployed django app with debug set to False 当 django 中的 Debug = False 时,为什么我在我的网站上看到服务器错误 500 - Why i am see server error 500 in my website when Debug = False in django 在设置文件上将 DEBUG 设置为 true 时出现错误 - I got error when I turn DEBUG true on settings file 当 DEBUG=False 时 django 服务器错误 (500) - django server error (500) when DEBUG=False 使用 Heroku 和 Django 时 Debug=False 时出现 500 错误 - 500 error when Debug=False with Heroku and Django "当我在 django 中读取文件字段时,我在生产中收到错误 500" - i got error 500 on production when i read filefield in django 当 debug 设置为 False 时,在 Heroku 上部署 Django 时出现服务器错误 500 - Server error 500 on Django when deployed on Heroku when debug is set to False Debug = False时,Django错误500-允许的主机设置为*。 控制台中没有任何内容 - Django error 500 when Debug=False - allowed hosts set to *. nothing in console 如何设置我的 django debug=False 并在出现错误时在网络上显示 404? - How do I set my django debug=False and show 404 on the web when there is error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM