CSRF Middleware - Change Csrf_token Output (from XHTML To HTML)
I've a problem with django csrf middleware... when I use the template tag csrf_token I get this output:
Solution 2:
The solution is actually very simple:
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
There is no point in {% with %}
construct.
Solution 3:
You have to go and edit django.template.defaulttags.py: At line 48 there is the output of the tag, and you may change it as you wish.
Please note that this is a development feature, and as such, subject to change - updating Django will likely remove your change!.
Also, please take the time to go look for a ticket about this particular problem: the solution I proposed will likely fix your problem, but I think that an “official” fix would be a lot nicer.
Post a Comment for "CSRF Middleware - Change Csrf_token Output (from XHTML To HTML)"