I am trying to add CSRF token protection using Flask-WTF's CSRFProtect
extension. The app isn't using WTForms except for this CSRF protection.
I followed the docs but I get "400 Bad Request The CSRF token is missing".
from flask_wtf.csrf import CSRFProtect
csrf = CSRFProtect(app)
I put the following in the templates (with form or without a form) but I get the same error.
<form method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
</form>