First time here? Check out the FAQ!
0

UndefinedError: 'settings' is undefined

I get this error whenever someone tries to signin to the site - using facebook, twitter or google log-ins. I have done the changes to settings.py suggested in a different thread, but did not help.

Sometimes the login works fine (even though this error is in the log) but sometimes user sees "Internal error occurred" - pls help.

Here is another observation: If i restart apache immediately after I see this error, things seem to work fine for some time, but then this problem starts again.

I have memcached installed, I dont know if that has got to do anything with this, I have confirmed that memcached is working fine, by doing the somekey someval thing.

Thanks

 [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47] mod_wsgi (pid=26844): Exception occurred processing WSGI script '/home/ubuntu/drdoubt/django.wsgi'.
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47] Traceback (most recent call last):
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 241, in __call__
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]     response = self.get_response(request)
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 179, in get_response
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]   File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]     return callback(request, **param_dict)
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]   File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]     response = view_func(request, *args, **kwargs)
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]   File "/usr/local/lib/python2.7/dist-packages/django/views/defaults.py", line 33, in server_error
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]     return http.HttpResponseServerError(t.render(Context({})))
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]   File "/usr/local/lib/python2.7/dist-packages/coffin/template/__init__.py", line 55, in render
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]     return super(Template, self).render(**context)
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47]     return self.environment.handle_exception(exc_info, True)
    [Mon Mar 11 00:37:35 2013] [error] [client 66.249.74.47 ...
(more)
junior123's avatar
63
junior123
asked 2013-03-11 00:49:18 -0600, updated 2013-03-11 00:53:00 -0600
edit flag offensive 0 remove flag close merge delete

Comments

Add DEBUG=True to your settings.py. What do you see then?

Evgeny's avatar Evgeny (2013-03-11 19:35:36 -0600) edit

I see the following in askbot log: (added as answer for lack of space here)

junior123's avatar junior123 (2013-03-12 00:35:25 -0600) edit

it's better to add it to the question, but the key is "relation X does not exist" that means you forgot to syncdb or migrate an app - in that case called "robots".

Evgeny's avatar Evgeny (2013-03-12 00:43:36 -0600) edit
add a comment see more comments

1 Answer

0
/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py TIME: 2013-03-12 00:33:50,722 MSG: base.py:handle_uncaught_exception:215 Internal Server Error: /robots.txt

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 136, in get_response response = response.render() File "/usr/local/lib/python2.7/dist-packages/django/template/response.py", line 104, in render self._set_content(self.rendered_content) File "/usr/local/lib/python2.7/dist-packages/django/template/response.py", line 81, in rendered_content content = template.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render return self._render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render return self.nodelist.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823, in render bit = self.render_node(node, context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837, in render_node return node.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 280, in render if match: File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 130, in __nonzero__ iter(self).next() File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 118, in _result_iter self._fill_cache() File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 875, in _fill_cache self._result_cache.append(self._iter.next()) File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 291, in iterator for row in compiler.results_iter(): File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 763, in results_iter for rows in self.execute_sql(MULTI): File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 818, in execute_sql cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 40, in execute return self.cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute return self.cursor.execute(query, args) DatabaseError: relation "robots_rule" does not exist LINE 1: ...s_rule"."robot", "robots_rule"."crawl_delay" FROM "robots_ru...

junior123's avatar
63
junior123
answered 2013-03-12 00:36:45 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments