A simple rest api to store database write/read operations
We made a makefile
to help you with you setup project. Check the file to see all commands availables.
# virtualenv
$ virtualenv -p python3 env
$ source env/bin/activate
# pyenv
$ pyenv virtualenv 3.7.4 dbmonit
$ pyenv activate dbmonit
$ cd dbmonit
$ pip install -r requirements-dev.txt
note: requirements-dev.txt
has all requirements packages to test, coverage and lint. If you don't want this packages, just run pip install -r requirements.txt
.
$ touch .env
add the env vars:
FLASK_APP=dbmonit.app
FLASK_ENV='development'
FLASK_DEBUG=1
SECRET_KEY="s3cr3t"
DATABASE_URL="mysql://localhost/dbmonit_db"
$ flask db init
$ psql -U postgres
psql (11.4)
Type "help" for help.
postgres=# create database dbmonit_db
$ flask db migrate
$ flask db upgrade
$ flask run
# secrets.toml
[default]
CSRF_SESSION_KEY = ""
JWT_SECRET_KEY = ""
TOKEN_SGP = ""
APP = ""
- Based on flask-blueprint project https://github.com/gabicavalcante/flask-blueprint