Closed qcaron closed 9 years ago
Hi, probably django.template.context_processors.request
is not in TEMPLATE_CONTEXT_PROCESSORS
.
Indeed! I will give it a try, thanks :)
ImportError at /
No module named context_processors
I am using django 1.7.7, seems django.template.context_processors.request
does not exist yet in this version.
And I am using 'django.core.context_processors.request'
.
Ok I have a little bit more information on this error: for example, it is raised when using AJAX with JsonResponse
in views. How may I avoid this error ??? This is important guys I really need help on this one =/
Should we test for key request
first ?
if context.get('request') and context['request'].COOKIES.get('cookielaw_accepted', False):
return ''
Hi @qcaron,
Unfortunately django-cookie-law is not being tested using Django 1.7 at the moment, so you'd have to work out way to handle this: https://github.com/TyMaszWeb/django-cookie-law/blob/master/.travis.yml#L7
From your traceback it seems like you're using the {% cookielaw_banner %}
tag in your 404.html
template (or the one 404.html
is extending).
There are a few issues here:
favicon.ico
django-cookie-law
should rather raise a warning than an exception when request context is not found in the response.It'd be great if you could take care of the last point and open a PR. Otherwise I'll try to look into this in the upcoming week.
Hi @qcaron
Can you please confirm that with version 1.0.6 this is fixed?
Thanks
Shouldn't this https://github.com/TyMaszWeb/django-cookie-law/blob/master/cookielaw/templatetags/cookielaw_tags.py#L25 use elif
instead of if
?
@centralniak I should be able to do some tests tomorrow ;)
But @paolodina is right, an error may be raised without using an elif
here.
@centralniak I confirm you that I still get the error.
The elif
is missing. Except that it should be good :)
Hey guys,
When in the admin, I keep getting KeyError 'request' errors:
Here is my whole traceback:
Is this related to the use of django-cookie-law or not? Any solution or thought?