繁体   English   中英

在Nginx后面调试Django / Gunicorn

[英]Debugging Django/Gunicorn behind Nginx

全新安装Nginx,Gunicorn,Supervisor,New Relic,Django,Postgres等。点击URL会产生很大的“内部服务器错误”。

在Nginx配置中启用调试会提供大量细节,但没有任何内容指出导致500错误的原因(只是它正在发生)。

接下来,我通过supervisorctl关闭了Gunicorn并通过python manage.py runserver启动了应用程序,点击了URL,一切运行正常。

退一步,关闭runserver并使用bin/gunicorn_django gunicorn_django手动启动bin/gunicorn_django ,这是我能够访问的最接近可用的跟踪日志:

2012-09-05 21:39:25 [5927] [ERROR] Error handling request
Traceback (most recent call last):
  File "/somewhere/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 102, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/somewhere/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
    response = self.get_response(request)
  File "/somewhere/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 82, in get_response
    urlconf = settings.ROOT_URLCONF
  File "/somewhere/local/lib/python2.7/site-packages/django/utils/functional.py", line 185, in inner
    return func(self._wrapped, *args)
AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'

我不是要求回答这里发生的事情,因为我知道这还不够详细。 ROOT_URLCONF问题是通用的,可能是由许多事情引起的。 我的问题是,我可以使用哪些后续步骤继续追踪正在发生的事情?

谢谢

提及Settings而不是settings (注意资本)是可疑的。 我个人注意到使用Aptana Studio, from django.conf import输入后出现的一个自动完成选项是Settings ,但这显然不是你真正想要的。 也许类似的事情发生了,你接受了错误的自动完成选择? 我会在您的项目中搜索Settings (当然是区分大小写),并根据需要将其更改为小写。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM