/flask-tutorial

The flask tutorial with extra features

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Flaskr

This a repo that use originally Flask tutorial with example code from Flask-SQLAlchemy project, adding Flask Migrate to use migrations, PostgreSQL as database. Can use a virtualenv or a container environment with Docker an Docker-Composer

the original tutorial is:

Install

You can follow original tutorial and create a virtualenv, but this version use containers to development and test. Before to use this repo, install Docker and Docker-Compose

# clone the repository
$ git clone https://github.com/fike/flask-tutorial

Run

For every change of model, run make migrate to update Alembic migrations.

$ export FLASK_APP=flaskr
$ export FLASK_ENV=development
$ make up-db
$ make migrate

Run using Docker and Docker-Compose

Open http://127.0.0.1:5000 in a browser.

Test

$ make test

Coverage report will generate in htmlcov directory

TODO

  • Add remote container development
  • Add cookie session
  • Add cookie for change color theme