A docker-compose.yml file is provided to help execute the application locally. Currently, it would only provide suport for the application's dependencies. Additionally, a Dockerfile is present for a containerized deployment.
The compose file provides the following dependencies:
- Postgres
- Docker
- Docker compose
- Python3.9
-
Clone repository
-
Configure environment variables
-
Create
.envfile from.env.sample$ cp .env.sample -
Open
.envfile and configure appropiatelly depending on the environment 1
-
-
Create virtual environment and activate it
python3 -m venv venv && source venv/bin/activate -
Install requirements
pip install -r requirements.txt -
Run dependencies in Docker
docker compose up -
Execute migrations
./manage.py migrate -
Run tests
./manage.py test -
Run app
./manage.py runserver -
Access the app's admin portal at
http://localhost:<PORT>/admin2 -
API authentication support Access the app admin pannel at
http://localhost:<PORT>/admin2
1: Using the environment variables as defined in .env.sample should be enough to locally execute the application.
2: The PORT value gets printed when running the runserver command (usually 8000). Admin credentials (email and password) should be as defined in the .env file.
3: The three authentication groups (Administrator, Viewer and User) are automatically created as part of the migration.
4: Currently, API authentication can be done using: basic username/password for easy testing (api/basic-auth/) and JWT. For JWT auth, provide the token in the header in the form of Authorization: Bearer <TOKEN>.
5: For production deployment an external storage such as S3 is recommended.