Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 1.73 KB

README.md

File metadata and controls

73 lines (45 loc) · 1.73 KB

Coverage Status Build Status Known Vulnerabilities

Gadget Backend

The Python REST backend project build in Docker. It is build using the Flask framework.

Contributing

If you want to contribute to the project please read our code of conduct and contributing guidelines.

Running development server

The project requires Python 3.6.x or newer.

Requirements

Make sure you install the dependencies using pip:

virtualenv gadget
pip install -r requirements.txt
pip install -e .

Create development database

To (re)create a developer/test DB in SQLite run

flask dev create-db

During this process you will be asked to remove the current database and fill the database with sample data.

Run the project

To run the project in development mode run:

./run_dev.sh

Run tests

To run the tests using Pytest run:

pytest tests/

Database migrations

This project uses Flask-Migrate to handle database migrations.

Creating a migration

If you need to create a new DB migration run the following command:

flask db migrate -m "<message>"

Applying migrations

To apply the migrations to your development database run:

flask db upgrade