[英]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.