Revision history [back]
UndefinedError: 'settings' is undefined
Hi, I'm on the current pip version on debian squeeze. The main part of the page is working, but if I e.g. want to change the "Site" via the admin interface the following error occurs:
My installation tries to render {{ settings.APP_TITLE|escape }} in /usr/local/lib/python2.6/dist-packages/askbot/templates/base.html" and throws "UndefinedError: 'settings' is undefined". Can anyone help me?
I have included this line
'askbot.context.application_settings',
in my settings in the TEMPLATE_CONTEXT_PROCESSORS which should make {{ settings}} available...
Here is the full traceback:
[Sat Dec 08 22:48:29 2012] [error][client x:x:x:x:x:x:x:x] mod_wsgi(pid=29866): Exception occurred processing WSGI script '/path/to/askbotproject/django.wsgi'.
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] Traceback (most recent call last):
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 241, in __call__
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] response = self.get_response(request)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 179, in get_response
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return callback(request, **param_dict)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] response = view_func(request, *args, **kwargs)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/views/defaults.py", line 33, in server_error
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return http.HttpResponseServerError(t.render(Context({})))
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/coffin/template/__init__.py", line 55, in render
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return super(Template, self).render(**context)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/jinja2/environment.py", line 894, in render
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return self.environment.handle_exception(exc_info, True)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/askbot/templates/500.html", line 1, in top-level template code
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] {% extends "two_column_body.html" %}
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/askbot/templates/two_column_body.html", line 1, in top-level template code
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] {% extends "base.html" %}
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/askbot/templates/base.html", line 4, in top-level template code
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/jinja2/environment.py", line 372, in getattr
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return getattr(obj, attribute)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] UndefinedError: 'settings' is undefined
UndefinedError: 'settings' is undefined
Hi, I'm on the current pip version on debian squeeze. The main part of the page is working, but if I e.g. want to change the "Site" via the admin interface the following error occurs:
My installation tries to render {{ settings.APP_TITLE|escape }} in /usr/local/lib/python2.6/dist-packages/askbot/templates/base.html" and throws "UndefinedError: 'settings' is undefined". Can anyone help me?
I have included this line
'askbot.context.application_settings',
in my settings in the TEMPLATE_CONTEXT_PROCESSORS which should make {{ settings}} available...
Here is the full traceback:
[Sat Dec 08 22:48:29 2012] [error][client x:x:x:x:x:x:x:x] mod_wsgi(pid=29866): Exception occurred processing WSGI script '/path/to/askbotproject/django.wsgi'.
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] Traceback (most recent call last):
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 241, in __call__
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] response = self.get_response(request)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 179, in get_response
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return callback(request, **param_dict)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] response = view_func(request, *args, **kwargs)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/django/views/defaults.py", line 33, in server_error
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return http.HttpResponseServerError(t.render(Context({})))
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/coffin/template/__init__.py", line 55, in render
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return super(Template, self).render(**context)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/jinja2/environment.py", line 894, in render
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return self.environment.handle_exception(exc_info, True)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/askbot/templates/500.html", line 1, in top-level template code
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] {% extends "two_column_body.html" %}
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/askbot/templates/two_column_body.html", line 1, in top-level template code
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] {% extends "base.html" %}
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/askbot/templates/base.html", line 4, in top-level template code
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] File "/usr/local/lib/python2.6/dist-packages/jinja2/environment.py", line 372, in getattr
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] return getattr(obj, attribute)
[Sat Dec 08 22:48:29 2012] [error] [client x:x:x:x:x:x:x:x] UndefinedError: 'settings' is undefined