Collect all similar endpoints in the app/controller folder. Use different files for logically dissimilar endpoints.
NOTE: Most of the general config is loaded into the environment from the .env file which should be created from the provided .env.template
Please use pipenv.
To install pipenv run pip install pipenv.
Use a separate virtual environment by running pipenv shell --three and then run pipenv install to install dependencies.
NOTE: Run pipenv install --dev to install all dependencies including development.
To install a new dependency, use pipenv install <pkg-name>. This will update Pipfile and Pipfile.lock
NOTE: use the flag --dev if it is a development dependency.
To upgrade a package, use pipenv install --selective-upgrade <pkg-name>.
Whenever a new dependency is added, be sure to run
pip freeze > requirements.txtMention dependency change in the commit message.
We serve most of the common commands collected in a Makefile.
make installmake testsmake runmake allTo build the container, make sure that the Dockerfile is present and run docker build -t minerva:latest .
To run the application from the docker container, run docker run minerva ARG where ARG can be db, run, test, shell or runserver.
For more information, run docker run common-backend --help.
If this is the first time that flask-migrate is being installed or run alongside existing database, use the
following command to create a head stamp in your database:
python manage.py db stamp head
If the migrations folder doesn't exist, use the following command before the above command.
python manage.py db init
It is recommended to perform Database upgrades, whenever database schema is updated, using the below commands:
python manage.py db upgrade
Remove the last database update using the below commands:
python manage.py db downgrade
Whenever a database model's schema is update, run the following command to generate migrations for it.
python manage.py db migrate
