diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-06-24 23:39:05 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-06-24 23:39:05 +0530 |
commit | e52c18a09cabd374093b06ef0f521767cd228ba6 (patch) | |
tree | 6548d357ba45e75334da8c225a0c6cd5f77f0850 /app/templates/wtform.html |
make it better
Diffstat (limited to 'app/templates/wtform.html')
-rw-r--r-- | app/templates/wtform.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/templates/wtform.html b/app/templates/wtform.html new file mode 100644 index 0000000..6d9add5 --- /dev/null +++ b/app/templates/wtform.html @@ -0,0 +1,20 @@ +{% extends 'base.html' %} + +{% block main %} + <h2>WTForms in Flask</h2> + <p>Here we are using the Flask-WTF library to create and process a form. Flask-WTF also comes with CSRF protection and validation classes.</p> + <form method="post" action="{{ url_for('wtform') }}"> + {% include 'flash_messages.html' %} + {{ form.csrf_token }} + <div class="form-group"> + {{ form.firstname.label }} {{ form.firstname(class="form-control") }} + </div> + <div class="form-group"> + {{ form.lastname.label }} {{ form.lastname(class="form-control") }} + </div> + <div class="form-group"> + {{ form.email.label }} {{ form.email(class="form-control", placeholder="jdoe@example.com") }} + </div> + <button type="submit" class="btn btn-primary">Submit</button> +</form> +{% endblock %}
\ No newline at end of file |