Skip to content Skip to sidebar Skip to footer

Howto: Dynamically Generate Csrf-token In Wtforms With Flask

I have a fruits form that has one FieldList object for the bananas: bananas = FieldList(FormField(BananaForm)) In the frontend, initially, I add one of those fields to the FieldLi

Solution 1:

I discovered how it works:

The CSRF-Tag can simply be copied. The id must be changed and incremented accordingly, but the hash may stay the same.

I didn't think it was possible to have many Fields with the same CSRF-Tag hash, but it actually does!

Post a Comment for "Howto: Dynamically Generate Csrf-token In Wtforms With Flask"