django - (yet another) Custom templatetag raising KeyError when DEBUG=False -
i'm trying use custom templatetag (this 1 actually: https://djangosnippets.org/snippets/2875/), on project works fine long debug=true. when it's false, relevant error part is:
file "...app/templatetags/helper_tags.py", line 15, in change_lang path = context['request'].path file "...local/lib/python2.7/site-packages/django/template/context.py", line 56, in __getitem__ raise keyerror(key) keyerror: 'request'
i've seen lot of questions , have done settings of them seen suggest are:
1) views.py uses django.shortcuts.render:
from django.shortcuts import render def home(request): return render(request, 'home.html')
2) settings.py contains:
allowed_hosts = ['*'] django.conf import global_settings template_context_processors = global_settings.template_context_processors + ( "django.core.context_processors.request", )
i've created new project same django version (1.6.2) tries imitate problematic project as possible, , despair works fine when debug=false.
any hints on appreciated.
cheers!
Comments
Post a Comment