Python version >= 3.6 is required. Using virtualenv
is advised.
-
Install requirements
pip install -r requirements.txt
-
Initialise database
python init_db.py
(uncommentadd_events()
inmain
block to insert some sample data) -
Run the app
python events.py
This app requires a PostgreSQL database instance running on port 5432
(can be changed in settings.py
)
The easiest way to do it is by running Docker:
docker run -d -p 5432:5432 postgres:11
To run tests you need a PostgreSQL database running and available on port 5433
(can be changed in settings.py
)
To set it up using Docker, just run create_test_db.sh
To run tests simply run
pytest
To run tests with coverage, run
pytest --cov
The app is currently configured to run in a DEBUG
mode. To run on production, some adjustments are necessary.