Tutorial link: https://www.python-engineer.com/posts/flask-todo-app/
Create project with virtual environment
$ mkdir myproject
$ cd myproject
$ python3 -m venv venv
Activate it
$ . venv/bin/activate
or on Windows
venv\Scripts\activate
Install Flask
$ pip install Flask
$ pip install Flask-SQLAlchemy
Set environment variables in terminal
$ export FLASK_APP=app.py
$ export FLASK_ENV=development
or on Windows
$ set FLASK_APP=app.py
$ set FLASK_ENV=development
Setup initial database by running python interactive shell using python
, then
from app import db, app
with app.app_context():
db.create_all()
Run the app
$ flask run