django-uni-form helpers and CSRF tags over POST
- by linked
Hi,
I'm using django-uni-forms to display my fields, with a rather rudimentary example straight out of their book.
When I render the form fields using <form>{%csrf_tag%} {%form|as_uni_form%}</form>, everything works as expected.
However, django-uni-form Helpers allow you to generate the form tag (and other helper-related content) using the following syntax -- {% with form.helper as helper %}{% uni_form form helper%}{%endwith%} -- This creates the <form> tag for me, so there's nowhere to embed my own CSRF_token. When I try to use this syntax, the form renders perfectly, but without a CSRF token, and so submitting the form fails every time.
Does anyone have experience with this? Is there an established way to add the token? I much prefer the second syntax, for re-use reasons.
Thanks!