/flask_tutorial

My version of the Flask Mega Tutorial

Primary LanguagePythonMIT LicenseMIT

flask_tutorial

My version of the Flask Mega Tutorial

the virtual environment

Virtual environment is called flaskapp, probably should have called venv per convention

$ source flaskapp/Scripts/activate # for windows when using GitBash

setting up environment variable

$ export FLASK_APP=microblog.py (or use set on windows when not using bash)

running the app

$ flask run

App then available locally at:

http://localhost:5000/

database migrations

Uses flask-migrate which integrates flask with alembic

$ flask db init # initialising the migration

$ flask db migrate -m ""

$ flask db upgrade # follow through with migration plan

flask environment

function 'make_shell_context()' sets up an environment for testing in the shell.

$ flask shell # for running the shell