0

我正在生产服务器上设置我的站点并且遇到了障碍。下面的错误出现在使用 gunicorn 运行 django 或仅通过“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'
4

1 回答 1

1

如果您要更新到 django 1.5,请删除:

django.contrib.admin.templatetags.adminmedia

从:

settings.py 中的 TEMPLATE_TAG_MODULES

这将消除错误。

于 2013-11-17T22:17:02.193 回答