https://github.com/mrchi/flask-tutorial
A Flask application written by following Tutorial in Flask Documents, make some difference.
https://github.com/mrchi/flask-tutorial
flask flask-tutorial flaskr
Last synced: 3 months ago
JSON representation
A Flask application written by following Tutorial in Flask Documents, make some difference.
- Host: GitHub
- URL: https://github.com/mrchi/flask-tutorial
- Owner: mrchi
- License: mit
- Created: 2019-04-23T15:59:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T22:51:15.000Z (almost 3 years ago)
- Last Synced: 2025-10-09T18:37:10.326Z (7 months ago)
- Topics: flask, flask-tutorial, flaskr
- Language: Python
- Homepage:
- Size: 84 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flask-tutorial
A Flask application named Flaskr, written by following [Tutorial in Flask Documents](http://flask.pocoo.org/docs/1.0/tutorial/).
Different from [official example](https://github.com/pallets/flask/tree/1.0.2/examples/tutorial), 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.)
- [x] Add CLI command for generating fake data;
- [x] Add testing for CLI command;