First time here? Check out the FAQ!
0

jinja2.exceptions.UndefinedError: 'skin' is undefined

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/wsgi.py", 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/base.py", 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/base.py", 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/decorators.py", 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/defaults.py", 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/__init__.py", 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/environment.py", 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/environment.py", 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/jinja2ext.py", 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/environment.py", line 397, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'skin' is undefined
odyssey's avatar
48
odyssey
asked 2013-12-04 11:26:09 -0500, updated 2013-12-04 11:30:38 -0500
edit flag offensive 0 remove flag close merge delete

Comments

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 -0500) edit

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

hollomancer's avatar hollomancer (2014-10-18 23:40:18 -0500) edit
add a comment see more comments

2 Answers

0

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.

hollomancer's avatar
1
hollomancer
answered 2014-10-19 20:26:14 -0500
edit flag offensive 0 remove flag delete link

Comments

were you able to fix this?

ivks's avatar ivks (2014-10-20 21:17:51 -0500) 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 `settings.py` 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 http://askbot.org/en/question/3192/database-migration-failure/?answer=4104#post-id-4104, 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 -0500) edit
add a comment see more comments
0

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.

  STATICFILES_DIRS += (

        ('default/media', os.path.join(ASKBOT_ROOT, 'media')),
    )
wdmytriy's avatar
13
wdmytriy
answered 2013-12-20 04:01:55 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments