danila_a's profile - activity
2013-01-29 03:15:51 -0500 | answered a question | UndefinedError: 'settings' is undefined "UndefinedError: 'settings' is undefined" exception in stactrace above happens in 500.html template. The'askbot.skins.loaders.Loader' is first loader in TEMPLATE_LOADERS. It loads 500.html(or 404, 403) template even outside of askbot app(for example in admin). Then it tries to render it, but there is no {{ settings }} in template context if current url not starts with ASKBOT_URL(see 'askbot.context.application_settings' context processor). The way to fix it is to use custom view to handle 500, 404, 403: In urls.py: We move our error templates for all apps to 'error/' subfolder in template folder. In this case askbot template loader can't find it and templates will be loaded using next loader in TEMPLATE_LOADERS - standard Django loader. Thus, we have separate error templates for our apps and for askbot. But it's still an ugly hack :) |