This is my working repository for the Flask tutorial.
The basic functionality of the blog was created by following along the tutorial snippets.
My own work really starts with the implementation of the features listed in the Keep Developing Section of the tutorial. The added features are: detail post view, likes, comments, tags, title search, pagination, image upload, markdown formatting and RSS feed.
It is definitely not pretty, but that was not the point of the exercise.
Clone the repo to a local directory.
$ git clone git@github.com:tbrlpld/flaskr.git
Change in to the flaskr
directory and create a virtual environment and activate it.
$ cd flaskr
$ python -m venv .venv
$ source .venv/bin/activate
Install the app (in editable mode) and its dependencies.
$ python -m pip install -e '.[dev]'
Initialize the database.
$ export FLASK_APP=flaskr
$ export FLASK_ENV=development
$ flask init-db
Run the app.
$ flask run
To run the tests just run pytest
in the project directory.
$ pytest
You can also run the tests and get a coverage report.
$ pytest --cov