Ask Your Question
1

How to fix "UndefinedError: 'settings' is undefined" in git branch

asked 2011-03-06 07:41:15 -0500

Adi Roiban gravatar image Adi Roiban
67 4 2 7

updated 2011-03-06 07:57:15 -0500

Hi,

I am trying the git branch and I got the following error. Does anyone has any clue of what might go wrong ... or what should I do to fix it. The version installed using pip is working.

I have upgrade askbot based on this information: http://askbot.org/en/question/310/how-do-you-manage-askbot-and-upgrades

It looks like it is related to the database upgrade... droping all tables and recreating the database solved this problem...

    Traceback (most recent call last):
  File "passenger_wsgi.py", line 22, in application
    return application(environ, start_response)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
    response = self.get_response(request)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/django/core/handlers/base.py", line 141, in get_response
    return self.handle_uncaught_exception(request, resolver, exc_info)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/django/core/handlers/base.py", line 180, in handle_uncaught_exception
    return callback(request, **param_dict)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/django/views/defaults.py", line 24, in server_error
    return http.HttpResponseServerError(t.render(Context({})))
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/django/template/__init__.py", line 165, in render
    return self.nodelist.render(context)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/django/template/__init__.py", line 784, in render
    bits.append(self.render_node(node, context))
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/django/template/__init__.py", line 797, in render_node
    return node.render(context)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/askbot/templatetags/extra_tags.py", line 124, in render
    return jinja_template.render(context)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/coffin/template/__init__.py", line 51, in render
    return super(Template, self).render(**context)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/askbot/skins/default/templates/500.jinja.html", line 1, in top-level template code
    {% extends "two_column_body.html" %}
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/askbot/skins/default/templates/two_column_body.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/askbot/skins/default/templates/base.html", line 4, in top-level template code
    {% spaceless %}
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/coffin/template/defaulttags.py", line 348, in _strip_spaces
    return strip_spaces_between_tags(caller().strip())
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/askbot/skins/default/templates/base.html", line 6, in template
    <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
  File "/var/www/intreaba.ubuntu.ro/lib/python2.5/site-packages/jinja2/environment.py", line 371, in getattr
    return getattr(obj, attribute)
delete close flag offensive retag edit

Comments

Which version of django are you using? Were there any other changes other than the database re-creation between the failed and the successful run? Evgeny ( 2011-03-06 20:20:58 -0500 )edit
Sometimes tracebacks from jinja2 templates are not very helpful. If in the settings.py you change DEBUG = True, TEMPLATE_DEBUG = False, the messages become more meaningful. That is probably the worst inconvenience of Jinja templates, other than that I like them much more than standard django templates. Evgeny ( 2011-03-06 20:37:17 -0500 )edit

Previous comment is true. I had the same traceback and when enabling the debug mode in settings.py it revealed another problem. See http://askbot.org/en/question/9815/database-integrityerror-in-admin/

Fabien Meghazi ( 2013-01-17 18:05:14 -0500 )edit

Previous comment is true. I had the same traceback and when enabling the debug mode in settings.py it revealed another problem. See http://askbot.org/en/question/9815/database-integrityerror-in-admin/

Fabien Meghazi ( 2013-01-17 18:05:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-03-06 12:25:47 -0500

Evgeny gravatar image Evgeny flag of Chile
11329 50 84 183
http://askbot.org/

updated 2011-03-06 12:27:39 -0500

Maybe you forgot to migrate the database?

python manage.py migrate askbot
link publish delete flag offensive edit

Comments

Uh... Thanks for the answer. I only did `python manage.py migrate` as in your other answer there was no notes about `python manage.py migrate askbot` Adi Roiban ( 2011-03-06 18:34:23 -0500 )edit
Well, your command actually does migrate askbot as well any other django apps that use South system for the database migrations. The origin of this error is not clear to me... It does not seem to be a migration issue, since you've said you have done it. Evgeny ( 2011-03-06 20:18:15 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: 2011-03-06 07:41:15 -0500

Seen: 203 times

Last updated: Mar 06 '11