This is the re-implemented code following The Flask Mega-Tutorial, which is very useful for beginners of flask, datebases or web developers.
flask
for Python HTTP serverflask_wtf
for flask formsflask_sqlalchemy
for SQL and databasesflask_migrate
for database upgrade
export FLASK_APP=./microblog.py
flask run
export FLASK_APP=./microblog.py
flask db migrate
flask db upgrade
python -m smtpd -n -c DebuggingServer localhost:8025
Then set up temporary server and start flask
export MAIL_SERVER=localhost
export MAIL_PORT=8025
export FLASK_APP=./microblog.py
flask run
python tests.py