Ask Your Question
1

How to diagnose UndefinedError: 'settings' is undefined ?

asked 2013-05-02 12:29:34 -0600

mrB gravatar image

I set up the site, it runs fine for a few months, then the server stops serving. I don't understand why the settings can't be found because nothing has changed on the server.

This is from the error_askbot_log:

[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1] mod_wsgi (pid=24567): Exception occurred processing WSGI script '/home/username/webapps/askbot/askbotSpirit/django.wsgi'.  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1] Traceback (most recent call last):  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/handlers/wsgi.py", line 272, in __call__  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     response = self.get_response(request)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", line 169, in get_response  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", line 218, in handle_uncaught_exception  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return callback(request, **param_dict)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/utils/decorators.py", line 93, in _wrapped_view  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     response = view_func(request, *args, **kwargs)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/Django-1.3.1-py2.7.egg/django/views/defaults.py", line 31, in server_error  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return http.HttpResponseServerError(t.render(Context({})))  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/coffin/template/__init__.py", line 55, in render  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return super(Template, self).render(**context)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/lib/python2.7/jinja2/environment.py", line 894, in render  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     return self.environment.handle_exception(exc_info, True)  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/webapps/askbot/askbot-discussion/askbot/templates/500.html", line 1, in top-level template code  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]     {% extends "two_column_body.html" %}  
[Thu May 02 12:17:45 2013] [error] [client 127.0.0.1]   File "/home/username/webapps/askbot/askbot-discussion/askbot/templates/two_column_body.html", line ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-05-09 08:15:52 -0600

mrB gravatar image

In the end, I found that my Memcache instance had been turned off. Once I restarted Memcache, everything worked great.

edit flag offensive delete link more
2

answered 2013-05-02 12:48:12 -0600

this is not settings.py missing, this is some issue with the template, the best way to do it is to update DEBUG = True in settings.py and see the error, this happens mostly due to import errors or missing migrations.

edit flag offensive delete link more

Comments

I turned DEBUG=True and I still don't think the settings are defined. I'm getting 'NoneType' object does not support item assignment from askbot-discussion/askbot/context.py line 31: my_settings['LANGUAGE_CODE'] = getattr(request, 'LANGUAGE_CODE', settings.LANGUAGE_CODE)

The settings are visible on the debug page, but it would seem I would not be getting a NoneType error if settings.LANGUAGE_CODE existed.

mrB gravatar imagemrB ( 2013-05-02 15:36:23 -0600 )edit

Ok, we will probably add self-test on LANGUAGE_CODE. It is a required setting for askbot.

Evgeny gravatar imageEvgeny ( 2013-05-02 19:25:18 -0600 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-05-02 12:29:34 -0600

Seen: 410 times

Last updated: May 09 '13