Skip to content

A Flask application written by following Tutorial in Flask Documents, make some difference.

License

Notifications You must be signed in to change notification settings

mrchi/flask-tutorial

Repository files navigation

flask-tutorial

A Flask application named Flaskr, written by following Tutorial in Flask Documents.

Different from official example, I use Flask extensions. such as:

  • Flask-SQLAlchemy
  • Flask-Login
  • Flask-Migrate

commands

database

docker run -d \
    --name flaskr-db \
    -e POSTGRES_USER=flask \
    -e POSTGRES_PASSWORD=flask123 \
    -e POSTGRES_DB=flaskr \
    -p 127.0.0.1:5432:5432 \
    postgres
psql -U flask -d flaskr -p 5432 -h localhost

testing

coverage run -m pytest
coverage report
coverage html

build and install

pip install wheel
python setup.py bdist_wheel
pip install flaskr-1.0.0-py3-none-any.whl
export FLASK_APP=flaskr
flask init-db
flask fake
flask run

TODO

  • [ ] Use JSON-Schema validating params; (It's convenient for API, not for templates.)
  • Add CLI command for generating fake data;
  • Add testing for CLI command;

About

A Flask application written by following Tutorial in Flask Documents, make some difference.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published