简体   繁体   中英

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. 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 ):

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.

Thanks

This was caused by the deprecated django.contrib.markup.templatetags.markup that my project was loading. It didn't seem to be used anywhere, so after removing it the pages started to work fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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