First time here? Check out the FAQ!

Revision history  [back]

VariableDoesNotExist error

When I attempt to upload a new logo in the Settings panel, I get the following in my logs:

[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139] mod_wsgi (pid=17280): Exception occurred processing WSGI script '/opt/cell-reference/django.wsgi'.
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139] Traceback (most recent call last):
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 272, in __call__
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     response = self.get_response(request)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 169, in get_response
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 218, in handle_uncaught_exception
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     return callback(request, **param_dict)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", line 93, in _wrapped_view
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     response = view_func(request, *args, **kwargs)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/views/defaults.py", line 31, in server_error
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     return http.HttpResponseServerError(t.render(Context({})))
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", line 123, in render
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     return self._render(context)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", line 117, in _render
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     return self.nodelist.render(context)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", line 744, in render
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     bits.append(self.render_node(node, context))
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", line 757, in render_node
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     return node.render(context)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/askbot/templatetags/extra_tags.py", line 92, in render
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     request = self.request_var.resolve(context)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", line 653, in resolve
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     value = self._resolve_lookup(context)
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]   File "/usr/local/lib/python2.6/dist-packages/django/template/base.py", line 692, in _resolve_lookup
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139]     raise VariableDoesNotExist("Failed lookup for key [%s] in %r", (bit, current)) # missing attribute
[Thu Apr 19 14:55:08 2012] [error] [client 109.145.40.139] VariableDoesNotExist: Failed lookup for key [request] in u'[{}]'

I've tried the suggestions in http://askbot.org/en/question/3095/django-error-variabledoesnotexist-failed-lookup, but urls.py seems fine, django.core.context_processors.request is in TEMPLATE_CONTEXT_PROCESSORS in settings.py, and the database migrations/syncing are up-to date.

I'm running Askbot 0.7.4 on Ubuntu 10.04 against Postgresql 8.4 on Python 2.6.5.