Sunday, May 8, 2011

Re: Inserting csrf-token in a form generated by a templatetag?

On Sun, May 08, 2011 at 10:13:23PM +0200, Thomas Weholt wrote:
> I've got a templatetag generating a form, but trying to add a
> csrf-token failes. What's the correct way to add a csrf-token to a
> form generated in plain html in a templatetag?
Basically, inside the template tag you'll have to resolve the context
variable 'csrf_token' using django.template.Variable.resolve() and
then include an <input type="hidden"> with its value.

Michal Petrucha

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate