Jinja Template with CSRF

Report a typo

class LoginFormSimple(FlaskForm):
    name = StringField("NAME")
    password = PasswordField("PASSWORD")

For the FlaskForm above, write the Jinja template that includes the CSRF token.

  • It should refer the fields name and password with the label;
  • It should refer the csrf token either with hidden_tag or csrf_token
Write a program in Python 3
template = """
<form>
<div class="form-group">
... insert your code here ...
</div>
</form>
"""
___

Create a free account to access the full topic