First time here? Check out the FAQ!
1

How to diagnose UndefinedError: 'settings' is undefined ?

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)
mrB's avatar
51
mrB
asked 2013-05-02 12:29:34 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

2

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.

Fitoria's avatar
1.1k
Fitoria
answered 2013-05-02 12:48:12 -0500
edit flag offensive 0 remove flag delete link

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's avatar mrB (2013-05-02 15:36:23 -0500) edit

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

Evgeny's avatar Evgeny (2013-05-02 19:25:18 -0500) edit
add a comment see more comments
0

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

mrB's avatar
51
mrB
answered 2013-05-09 08:15:52 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments