Django Template Errors

Admin Template Errors#

Caught an exception while rendering: Failed lookup for key [ name ] in u'None'#

Discussed : http://code.djangoproject.com/ticket/10275

Fix (as on Django 1.0.2):

in /usr/lib/python2.5/site-packages/Django-1.0.2_final-py2.5.egg/django/template/_ _ init _ _.py

on line 729, where it says

     raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute

replace with

    if bit == 'name':
        current = settings.TEMPLATE_STRING_IF_INVALID
    else:
        raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute       

Make sure the 'if' is indented four spaces from the 'except'.

Also delete the init.pyc file.


Django