error logging in after updating to 1.9

187 views
Skip to first unread message

Larry Martell

unread,
Jun 28, 2016, 4:05:06 PM6/28/16
to django...@googlegroups.com
I had a 1.6 app and I updated to 1.9. Now when I try to login it fails
and I see this in the logs. This works in 1.6. Any ideas what the
issue is?

[28/Jun/2016 17:43:51] DEBUG [django.template:923] Exception while
resolving variable 'STATIC_URL' in template 'registration/login.html'.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py",
line 901, in _resolve_lookup
(bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [STATIC_URL] in
u"[{'False': False, 'None': None, 'True': True}, {u'csrf_token':
<SimpleLazyObject: <function _get_val at 0x7f0e9b8886e0>>,
'PYTHON_VERSION': '2.7.9 (default, Mar 1 2015, 13:01:26) ', 'perms':
<django.contrib.auth.context_processors.PermWrapper object at
0x7f0e9ae23290>, u'request': <WSGIRequest: GET '/'>, 'ELUCID_VERSION':
'unknown', 'messages':
<django.contrib.messages.storage.fallback.FallbackStorage object at
0x7f0e9ae23310>, 'is_elucid': True, 'my_reports': {},
'ELUCID_HOSTNAME': '0d226ac61524', 'user': <SimpleLazyObject: <User:
admin>>, 'ELUCID_SERVER_NAME': 'localhost', 'NAVSTRUCT': [],
'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'WARNING': 30,
'SUCCESS': 25, 'ERROR': 40}, 'base_template': 'base_elucid.html',
'DJANGO_VERSION': '1.9'}, {}, {'site_name': 'bekku.bbmsc.com:8004',
'site': <django.contrib.sites.requests.RequestSite object at
0x7f0e9ae23750>, 'form': <AuthenticationForm bound=False,
valid=Unknown, fields=(username;password)>, 'next': ''}]"
[28/Jun/2016 17:43:51] DEBUG [django.template:923] Exception while
resolving variable 'msie6_user_agent' in template
'registration/login.html'.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py",
line 901, in _resolve_lookup
(bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [msie6_user_agent] in
u"[{'False': False, 'None': None, 'True': True}, {u'csrf_token':
<SimpleLazyObject: <function _get_val at 0x7f0e9b8886e0>>,
'PYTHON_VERSION': '2.7.9 (default, Mar 1 2015, 13:01:26) ', 'perms':
<django.contrib.auth.context_processors.PermWrapper object at
0x7f0e9ae23290>, u'request': <WSGIRequest: GET '/'>, 'ELUCID_VERSION':
'unknown', 'messages':
<django.contrib.messages.storage.fallback.FallbackStorage object at
0x7f0e9ae23310>, 'is_elucid': True, 'my_reports': {},
'ELUCID_HOSTNAME': '0d226ac61524', 'user': <SimpleLazyObject: <User:
admin>>, 'ELUCID_SERVER_NAME': 'localhost', 'NAVSTRUCT': [],
'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'WARNING': 30,
'SUCCESS': 25, 'ERROR': 40}, 'base_template': 'base_elucid.html',
'DJANGO_VERSION': '1.9'}, {}, {'site_name': 'bekku.bbmsc.com:8004',
'site': <django.contrib.sites.requests.RequestSite object at
0x7f0e9ae23750>, 'form': <AuthenticationForm bound=False,
valid=Unknown, fields=(username;password)>, 'next': ''}]"
[28/Jun/2016 17:43:51] DEBUG [django.template:923] Exception while
resolving variable 'STATIC_URL' in template 'registration/login.html'.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py",
line 901, in _resolve_lookup
(bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [STATIC_URL] in
u"[{'False': False, 'None': None, 'True': True}, {u'csrf_token':
<SimpleLazyObject: <function _get_val at 0x7f0e9b8886e0>>,
'PYTHON_VERSION': '2.7.9 (default, Mar 1 2015, 13:01:26) ', 'perms':
<django.contrib.auth.context_processors.PermWrapper object at
0x7f0e9ae23290>, u'request': <WSGIRequest: GET '/'>, 'ELUCID_VERSION':
'unknown', 'messages':
<django.contrib.messages.storage.fallback.FallbackStorage object at
0x7f0e9ae23310>, 'is_elucid': True, 'my_reports': {},
'ELUCID_HOSTNAME': '0d226ac61524', 'user': <SimpleLazyObject: <User:
admin>>, 'ELUCID_SERVER_NAME': 'localhost', 'NAVSTRUCT': [],
'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'WARNING': 30,
'SUCCESS': 25, 'ERROR': 40}, 'base_template': 'base_elucid.html',
'DJANGO_VERSION': '1.9'}, {}, {'site_name': 'bekku.bbmsc.com:8004',
'site': <django.contrib.sites.requests.RequestSite object at
0x7f0e9ae23750>, 'form': <AuthenticationForm bound=False,
valid=Unknown, fields=(username;password)>, 'next': ''}]"
[28/Jun/2016 17:43:51] DEBUG [django.template:923] Exception while
resolving variable 'User' in template 'registration/login.html'.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py",
line 901, in _resolve_lookup
(bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [User] in u"<WSGIRequest: GET '/'>"
[28/Jun/2016 17:43:51] WARNING [django.request:182] Not Found:
/scripts/chosen/chosen.css
[28/Jun/2016 17:43:51] DEBUG [django.template:923] Exception while
resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py",
line 901, in _resolve_lookup
(bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [name] in
u'<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'
[28/Jun/2016 17:43:51] WARNING [django.request:182] Not Found:
/scripts/chosen/chosen.jquery.min.js
[28/Jun/2016 17:43:51] DEBUG [django.template:923] Exception while
resolving variable 'name' in template 'unknown'.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py",
line 901, in _resolve_lookup
(bit, current)) # missing attribute
VariableDoesNotExist: Failed lookup for key [name] in
u'<RegexURLResolver <RegexURLPattern list> (admin:admin) ^admin/>'

Tim Graham

unread,
Jun 28, 2016, 9:15:06 PM6/28/16
to Django users
Did you upgrade Django version by version as suggested in our upgrade guide [0] and fix deprecation warnings along the way? That might help alert you to the issue.

[0] https://docs.djangoproject.com/en/dev/howto/upgrade-version/

Larry Martell

unread,
Jun 30, 2016, 6:56:54 AM6/30/16
to django...@googlegroups.com
It seems like in 1.6 template code like this:

{% if error %}
...
{% endif %}

Was OK. But in 1.9 if error is not defined it throws an exception. So
in 1.9 what is the proper way to check to see if a variable is defined
or not?

Tim Graham

unread,
Jul 1, 2016, 7:53:03 PM7/1/16
to Django users
Perhaps the issue is a bit different as I don't see that same behavior.
Reply all
Reply to author
Forward
0 new messages