Flask boilerplate project with multiple API version support.
- In root directory, create an environment variable and activate
python -m venv venv venv\Scripts\activate
- Install packages
pip install -r requirements.txt
- In
src
, create a.env
file and addFLASK_ENV=dev # or prod SECRET_KEY=SECRET_KEY
- In
src
, do migrationspython manage.py db init python manage.py db migrate python manage.py db upgrade
- Run server
python manage.py runserver
- Open http://127.0.0.1:5000/ and it should show the Swagger-UI. This is disabled in
prod
environment.
- Heroku
- Create heroku app
- Update config with the Postgres URL from Heroku
- Initialize, migrate and upgrade the database
- Set the environment variables in Heroku
- Deploy the app