[英]AttributeError: 'NoneType' object has no attribute 'tags' - upgrade Django to 1.6.5
I'm trying to upgrade an old project from Django 1.4 to Django 1.7 and I'm doing it version by version. 我正在尝试将旧项目从Django 1.4升级到Django 1.7,并且正在逐个版本进行操作。 I managed to make it work fine in 1.5.8 , but on 1.6.5 I can't get past the error below (the error also appears in latest 1.7c2 ): 我设法使其在1.5.8中可以正常工作,但是在1.6.5上我无法克服以下错误(该错误也出现在最新的1.7c2中 ):
mod_wsgi (pid=2364): Exception occurred processing WSGI script '/home/dev/web/project_dir/wsgi/dev/dev-project-local.wsgi'.
Traceback (most recent call last):
File "/home/dev/.envs/project_env/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 206, in __call__
response = self.get_response(request)
File "/home/dev/.envs/project_env/lib/python2.7/site-packages/django/core/handlers/base.py", line 146, in get_response
response = debug.technical_404_response(request, e)
File "/home/dev/.envs/project_env/lib/python2.7/site-packages/django/views/debug.py", line 481, in technical_404_response
t = Template(TECHNICAL_404_TEMPLATE, name='Technical 404 template')
File "/home/dev/.envs/project_env/lib/python2.7/site-packages/django/template/base.py", line 125, in __init__
self.nodelist = compile_string(template_string, origin)
File "/home/dev/.envs/project_env/lib/python2.7/site-packages/django/template/base.py", line 152, in compile_string
parser = parser_class(lexer.tokenize())
File "/home/dev/.envs/project_env/lib/python2.7/site-packages/django/template/base.py", line 239, in __init__
self.add_library(lib)
File "/home/dev/.envs/project_env/lib/python2.7/site-packages/django/template/base.py", line 353, in add_library
self.tags.update(lib.tags)
AttributeError: 'NoneType' object has no attribute 'tags'
What can cause this error and where should I look for problems? 什么会导致此错误,我应该在哪里查找问题?
Using Python 2.7.3, mod_wsgi, apache. 使用Python 2.7.3,mod_wsgi,apache。
Thanks 谢谢
This was caused by the deprecated django.contrib.markup.templatetags.markup
that my project was loading. 这是由于我的项目正在加载而弃用的django.contrib.markup.templatetags.markup
引起的。 It didn't seem to be used anywhere, so after removing it the pages started to work fine. 它似乎没有在任何地方使用,因此在删除它之后,页面开始正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.