Minimal python restful API
Switch branches/tags
Nothing to show
Clone or download
Latest commit f3cd7e6 Oct 10, 2018
Failed to load latest commit information.
src Ensure API doesn't listen to Jun 20, 2016
test add mock example Jul 6, 2015
.gitignore Initial commit Feb 27, 2015 Update Oct 10, 2018
docker-compose.yml Improve boilerplate Jun 5, 2015
requirements.txt Fix requirements file Nov 23, 2015

This repo is deprecated, please use instead


git clone && cd flask-boilerplate
docker-compose run --rm server pip install -r requirements.txt --user --upgrade
docker-compose up -d server

Accessing containers

Require Docker >= 1.3

# use 'docker ps' to see the list of your containers
docker exec -it flaskboilerplate_db_1 psql -Upostgres
docker exec -it flaskboilerplate_server_1 bash

Migration process

# Prior to the first migration
docker-compose run --rm server python src/ db init

# Create a new version of the database
docker-compose run --rm server python src/ db migrate
# check file + remove comment + improve file if needed
sudo vim migration/versions/<migration_id>.py

# Upgrade your database to the last version
docker-compose run --rm server python src/ db upgrade

Run tests

docker-compose run --rm server python -m unittest


# Screenshot of python vendors
docker-compose run --rm server pip freeze > requirements.txt

# Run a command in the server container:
docker-compose run --rm server <command>