Ask Your Question

UndefinedError: 'settings' is undefined

asked 2010-12-07 03:58:14 -0600

suyu8776 gravatar image

updated 2012-08-13 09:10:37 -0600

todofixthis gravatar image

In windows,i install askbot ,when i open http://localhost:8000 in chrome.I get these error.Would someone tell me the reson?

File "c:\python25\lib\site-packages\jinja2-2.5.5-py2.5.egg\jinja2\", line 371, in getattr

return getattr(obj, attribute)

UndefinedError: 'settings' is undefined

edit retag flag offensive close merge delete


Maybe you dont have the filled out correctly? The starting copy is in askbot/setup_templates or you can use "startforum" script that installs with askbot. I think what is missing is the askbot's template context processor, which injects that settings variable into the templates.
Evgeny gravatar imageEvgeny ( 2010-12-07 04:15:58 -0600 )edit
I downloaded a new version 0.6.41,and the problem has gone.But i found that there wasn't a whole database dump file(mysql),and i used " syncdb" script couldn't sync all tables; I hope there is a whole database dump file in the next version.
suyu8776 gravatar imagesuyu8776 ( 2010-12-09 01:04:07 -0600 )edit
Hey it's great that you've sorted this out. Now in addition to syncdb please run "python migrate" that will complete the database creation. It is actually described in the manual. There is a link "install/docs" above in the header.
Evgeny gravatar imageEvgeny ( 2010-12-09 01:16:24 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2012-08-13 08:15:36 -0600

NickJ gravatar image

I had the issue. The problem was I was missing the askbot context processor. Add this to your

'askbot.user_messages.context_processors.user_messages', #must be before auth
edit flag offensive delete link more


I'm running askbot.noarch 0-.7.49-1.el6 (installed via yum on CentOS 6.5), my already has the entry mentioned, but I'm still getting the UndefinedError: 'settings' is undefined when trying to post a question to my site. Any thoughts? Is it correct that this context processor should be defined under the TEMPLATE_CONTEXT_PROCESSORS?

JohnB gravatar imageJohnB ( 2014-05-19 10:09:06 -0600 )edit

answered 2010-12-07 04:00:12 -0600

suyu8776 gravatar image

Traceback (most recent call last):

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\core\servers\", line 279, in run self.result = application(self.environ, self.start_response)

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\core\servers\", line 651, in __call__ return self.application(environ, start_response)

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\core\handlers\", line 241, in __call__ response = self.get_response(request)

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\core\handlers\", line 141, in get_response return self.handle_uncaught_exception(request, resolver, exc_info)

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\core\handlers\", line 180, in handle_uncaught_exception return callback(request, **param_dict)

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\views\", line 24, in server_error return http.HttpResponseServerError(t.render(Context({})))

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\", line 165, in render return self.nodelist.render(context)

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\", line 784, in render bits.append(self.render_node(node, context))

File "c:\python25\lib\site-packages\django-1.1.2-py2.5.egg\django\", line 797, in render_node return node.render(context)

File "c:\python25\lib\site-packages\askbot-0.6.39-py2.5.egg\askbot\templatetags\", line 125, in render return jinja_template.render(context)

File "c:\python25\lib\site-packages\coffin-0.3-py2.5.egg\coffin\", line 51, in render return super(Template, self).render(**context)

File "c:\python25\lib\site-packages\jinja2-2.5.5-py2.5.egg\jinja2\", line 891, in render return self.environment.handle_exception(exc_info, True)

File "C:\Python25\lib\site-packages\askbot-0.6.39-py2.5.egg\askbot\skins\default\templates\500.jinja.html", line 1, in top-level template code {% extends "two_column_body.html" %}

File "C:\Python25\lib\site-packages\askbot-0.6.39-py2.5.egg\askbot\skins\default\templates\two_column_body.html", line 1, in top-level template code {% extends "base.html" %}

File "C:\Python25\lib\site-packages\askbot-0.6.39-py2.5.egg\askbot\skins\default\templates\base.html", line 4, in top-level template code {% spaceless %}

File "c:\python25\lib\site-packages\coffin-0.3-py2.5.egg\coffin\template\", line 348, in _strip_spaces return strip_spaces_between_tags(caller().strip())

File "C:\Python25\lib\site-packages\askbot-0.6.39-py2.5.egg\askbot\skins\default\templates\base.html", line 6, in template <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>

File "c:\python25\lib\site-packages\jinja2-2.5.5-py2.5.egg\jinja2\", line 371, in getattr return getattr(obj, attribute)

UndefinedError: 'settings' is undefined

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2010-12-07 03:58:14 -0600

Seen: 1,794 times

Last updated: Aug 13 '12