old_contents: from flask import Flask, render_template, redirect, url_for
  from flask_script import Manager
  from flask_bootstrap import Bootstrap, WebCDN
  from flask_wtf import Form
  from wtforms import StringField, SubmitField, PasswordField
  from wtforms.validators import Required, Email
  
  app = Flask(__name__)
  app.config['SECRET_KEY'] = 'temp' # FIXME
  manager = Manager(app)
  bootstrap = Bootstrap(app)
  app.extensions['bootstrap']['cdns']['jquery'] = WebCDN(
      '//cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/' # Use jquery 3.0.0
  )
  
  class RegisterForm(Form):
      email = StringField('Email', validators=[Required(), Email()])
      password = PasswordField('Password', validators=[Required()])
      submit = SubmitField('Register')
  
  @app.route('/')
  def index():
      return render_template('index.html')
  
  @app.route('/register', methods=['GET', 'POST'])
  def register():
      form = RegisterForm()
      if form.validate_on_submit():
          print("A new user have successfully registred")
          return redirect(url_for('index'))
      return render_template('register.html', form=form)
  
  
  if __name__ == '__main__':
      manager.run()
  
  
new_contents: import os
  from flask import Flask, render_template, redirect, url_for
  from flask_script import Manager
  from flask_bootstrap import Bootstrap, WebCDN
  from flask_wtf import Form
  from wtforms import StringField, SubmitField, PasswordField
  from wtforms.validators import Required, Email
  from flask_sqlalchemy import SQLAlchemy
  
  basedir = os.path.abspath(os.path.dirname(__file__))
  
  app = Flask(__name__)
  app.config['SECRET_KEY'] = 'temp' # FIXME
  app.config['SQLALCHEMY_DATABASE_URI'] = \
          'sqlite:///' + os.path.join(basedir, 'data.sqlite')
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
  bootstrap = Bootstrap(app)
  manager = Manager(app)
  db = SQLAlchemy(app)
  
  app.extensions['bootstrap']['cdns']['jquery'] = WebCDN(
      '//cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/' # Use jquery 3.0.0
  )
  
  class Role(db.Model):
      __tablename__ = 'roles'
      id = db.Column(db.Integer, primary_key=True)
      name = db.Column(db.String(64), unique=True)
      users = db.relationship('User', backref='role', lazy='dynamic')
  
      def __repr__(self):
          return "<Role {}>".format(self.name)
  
  class User(db.Model):
      __tablename__ = 'users'
      id = db.Column(db.Integer, primary_key=True)
      email = db.Column(db.String(120), unique=True, index=True)
      role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))
  
      def __repr__(self):
          return "<User {}>".format(self.username)
  
  
  class RegisterForm(Form):
      email = StringField('Email', validators=[Required(), Email()])
      password = PasswordField('Password', validators=[Required()])
      submit = SubmitField('Register')
  
  @app.route('/')
  def index():
      return render_template('index.html')
  
  @app.route('/register', methods=['GET', 'POST'])
  def register():
      form = RegisterForm()
      if form.validate_on_submit():
          print("A new user have successfully registred")
          return redirect(url_for('index'))
      return render_template('register.html', form=form)
  
  
  if __name__ == '__main__':
      db.create_all()
      manager.run()
  
  
subject: Add database (not used ATM)