Closed mzu closed 11 years ago
Hi mzu, I got the same warnings when I started to use Dajax. I've solved the issue using TemplateResponse in place of render_to_string, because you need to render the template with the request:
from django.template.response import TemplateResponse ... render = TemplateResponse(request, template, context).render().content
Bye.
Thanks esevece, I will try your approach!
Hi there.
When I request a form via django-dajax I get
warnings.warn("A {% csrf_token %} was used in a template, but the context did not provide the value. This is usually caused by not using RequestContext.")
I there a way to set the csrf token in django-dajax using the request header (see https://docs.djangoproject.com/en/1.2/ref/contrib/csrf/#csrf-ajax).
What would be the best way to deal with this issue?
Thanks + great work!
Mischa