Ask Your Question

jinja2.exceptions.UndefinedError: 'skin' is undefined

asked 2013-12-04 11:26:09 -0600

odyssey's avatar

updated 2013-12-04 11:30:38 -0600

I am getting this error after some time starting the server, what might be the reason? using code from github

Traceback (most recent call last):
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/core/handlers/", line 255, in __call__
    response = self.get_response(request)
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/core/handlers/", line 178, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/core/handlers/", line 224, in handle_uncaught_exception
    return callback(request, **param_dict)
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/utils/", line 91, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Django-1.5-py2.7.egg/django/views/", line 41, in server_error
    return http.HttpResponseServerError(template.render(Context({})))
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Coffin-0.3.8-py2.7.egg/coffin/template/", line 55, in render
    return super(Template, self).render(**context)
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Jinja2-2.7.1-py2.7.egg/jinja2/", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Jinja2-2.7.1-py2.7.egg/jinja2/", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "./askbot/templates/500.html", line 1, in top-level template code
    {% extends "two_column_body.html" %}
  File "./askbot/templates/two_column_body.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "./askbot/templates/base.html", line 27, in top-level template code
    {% include "meta/html_head_stylesheets.html" %}
  File "./askbot/templates/meta/html_head_stylesheets.html", line 7, in top-level template code
    {% compress css %}
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/django_compressor-1.2-py2.7.egg/compressor/contrib/", line 40, in _compress
    original_content = caller()
  File "./askbot/templates/meta/html_head_stylesheets.html", line 9, in template
    {{ skin.get_extra_css_link() }}
  File "/home/myuser/projects/venv/local/lib/python2.7/site-packages/Jinja2-2.7.1-py2.7.egg/jinja2/", line 397, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'skin' is undefined
edit retag flag offensive close merge delete


I see this error too on an uncustomised AskBot install. It happens for various actions in the admin system, including logging out.

Eric Clack's avatar Eric Clack  ( 2014-01-14 10:08:39 -0600 )edit

I am also encountering this issue after turning DEBUG to False.

hollomancer's avatar hollomancer  ( 2014-10-18 23:40:18 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-19 20:26:14 -0600

I have been encountering this same error here and there. Changing DEBUG to True revealed that this error is really hiding other errors. Once I fixed the error behind it, this stopped happening.

edit flag offensive delete link more


were you able to fix this?

ivks's avatar ivks  ( 2014-10-20 21:17:51 -0600 )edit

I was also getting `UndefinedError: 'skin' is undefined` when trying to save users in the Django admin (I'm trying to grant superuser permissions to some users). When I set `DEBUG = True` in `` this revealed that the underlying error was: IntegrityError at /admin/auth/user/23/ (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`askbot`.`askbot_groupmembership`, CONSTRAINT `authusergroups_ptr_id_refs_id_e728db87` FOREIGN KEY (`authusergroups_ptr_id`) REFERENCES `auth_user_groups` (`id`))') Googling for this error led me to, which recommends switching to Postgres or switching from MySQL InnoDB to MySQL MyISAM (which isn't that attractive because MyISAM doesn't support foreign keys).

frankoid's avatar frankoid  ( 2015-01-28 05:26:10 -0600 )edit

answered 2013-12-20 04:01:55 -0600

wdmytriy's avatar

I had similar problem(i use askbot as a part of another django app). Most probably you've missed to add skin directory to your staticdirs path.


        ('default/media', os.path.join(ASKBOT_ROOT, 'media')),
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: 2013-12-04 11:26:09 -0600

Seen: 2,969 times

Last updated: Oct 20 '14