To start a new project, click on the "Use this template" button.
The project
folder is where the main configuration will go. Rename the folder and files to match real project name
It is advisable to create the rest of the apps in the project in an app
folder with the next command:
django-admin startproject
And the structure of the project will remain as follows
- app/app1
- app/app2
Dont forget to add the SENTRY_PROJECT
secret to the repository, this will allow sentry to track the releases.
The backend run in Docker. We need to have docker (docker-engine) and docker-compose installed
To build Docker images (remember that you have to do this everytime you add a new dependency to Pipfile too)
docker-compose build
The first time we start the project locally it will be necessary to migrate the data and create a superuser
docker-compose run --rm backend poetry run python manage.py migrate
docker-compose run --rm backend poetry run python manage.py createsuperuser
Start everything (redis, postgress, server, celery and rest of things written in docker-compose.yml)
docker-compose up
Always use {PROJECT-NAME}.settings_test
as Django settings file as we sometimes need to override production settings
docker-compose run -e DJANGO_SETTINGS_MODULE={PROJECT-NAME}.settings_test --rm backend poetry run coverage run --source='.' manage.py test
docker-compose run --rm backend poetry run coverage html
cd htmlcov
npx http-server
Open localhost:8080
in your browser