我正在生产服务器上设置我的网站,并且已经碰壁了。 下面的错误显示运行django与gunicorn或只是通过“manage.py runserver” Gunicorn / runserver启动正常,但是当请求页面时会报告此错误。 任何关于在哪里寻找或可能的原因的建议都将不胜感激。
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 125, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
return self.application(environ, start_response)
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
response = self.get_response(request)
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/core/handlers/base.py", line 221, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/views/debug.py", line 66, in technical_500_response
html = reporter.get_traceback_html()
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/views/debug.py", line 285, in get_traceback_html
t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 template')
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/template/base.py", line 125, in __init__
self.nodelist = compile_string(template_string, origin)
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/template/base.py", line 152, in compile_string
parser = parser_class(lexer.tokenize())
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/template/debug.py", line 35, in __init__
super(DebugParser, self).__init__(lexer)
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/template/base.py", line 232, in __init__
self.add_library(lib)
File "/home/geoff/virtualenvs/mysite/lib/python2.7/site-packages/django/template/base.py", line 339, in add_library
self.tags.update(lib.tags)
AttributeError: 'NoneType' object has no attribute 'tags'
答案 0 :(得分:1)
如果您要更新到django 1.5,请删除:
django.contrib.admin.templatetags.adminmedia
自:
settings.py
中的TEMPLATE_TAG_MODULES这将消除错误。