In this Flask tutorial, we're going to be wrapping up this registration system.
In order to do this, we're going to probably need a register.html page.
File: register.html Location: /var/www/PythonProgramming/PythonProgramming/templates/register.html
{% extends "header.html" %} {% block body %} <body> <div class = "container"> <h4>Register</h4> <br> {% from "_formhelpers.html" import render_field %} <form method=post action="/register/"> <dl> {{render_field(form.username)}} {{render_field(form.email)}} {{render_field(form.password)}} {{render_field(form.confirm)}} {{render_field(form.accept_tos)}} </dl> <p><input type=submit value=Register></p> </form> {% if error %} <p class="error"><strong>Error:</strong>{{error}}</p> {% endif %} </div> </body> {% endblock %}
Here's a fairly typical registration form, only with the fields being rendered from the form object that we are passing through.