Posted on 2020-06-02T06:30:03Z by Kevin Foong
This is the second part of my tutorial to create a fully functioning user registration and login form in Flask. In the first part of the tutorial we looked at the backend side especially Flask SQLAlchemy and the database. I assume you have already set up everything from the first part and this will just be a continuation of it. In this part we will focus on the Flask side, in particular Flask WTF and Flask Login. Part 1 is available here.
1. First install flask-wtf and flask-login in your project's virtual environment. "wtforms[email]" is just an extra package from wtforms which provides email validation which we will use later.
pip install flask-wtf
pip install wtforms[email]
pip install flask-login
Read more ...
Posted on 2020-06-01T12:33:45Z by Kevin Foong
In this post we will go through how to create a fully functional login and registration form in Flask. Part 1 (this post) will go through the backend part - setting up Flask, Flask-SQLAlchemy and creating the database. In part 2 we will build the actual forms and templates and see this in action.
In this tutorial we will start from the beginning, assuming that you only have Python installed. This tutorial was created using Windows but should be similar for other operating systems.
1. Create a folder for your project. Then in this folder create a Python virtual environment.
python -m venv env
2. Activate your virtual environment.
3. Install the following packages.
Read more ...