SECRET_KEY
- django SECRET_KEY from settingsDEBUG
- 1 or 0. Debug mode in DjangoDATABASE_URL
- URL in the format of dj-database-urlRUN_MIGRATIONS
- Flag to run migratioins or not. Set 1 to run migrations while container starting.CREATE_SUPERUSER
- Flag to create superuser or not. Set 1 to createsuperuser while container starting. Also must set another superuser environment variables, look next.DJANGO_SUPERUSER_PASSWORD
- superuser password. Need it and it is applied only when CREATE_SUPERUSER=1DJANGO_SUPERUSER_USERNAME
- superuser username. Need it and it is applied only when CREATE_SUPERUSER=1DJANGO_SUPERUSER_EMAIL
- superuser email. Need it and it is applied only when CREATE_SUPERUSER=1
AMOCRM_ENTITIES_ENDPOINT_AUTH_KEY
- Auth key for third-party server requests for fetching amoCRM entities for salary calculatingSALARIES_DASHBOARD_AUTH_KEY
- Auth key for access to salaries dashboard on application server on page https://{{hostname}}/salaries/sales-plan-progress?auth_key={{AUTH_KEY}}.
For docker environment variables look Docker section
$ poetry install
$ poetry shell
Create .env file in folder and set necessary values for env variables
$ poetry run python manage.py collectstatic --no-input
$ poetry run python manage.py migrate --no-input
$ poetry run python manage.py createsuperuser
$ make runserver
$ make lint
$ make test
$ make test-coverage
Here is a docker-compose.yml config example, which is actually ready for local machine launch.
Before launch you need to do next. It's optional, but you should know about it:
Set env variables in docker-compose.yml (parameter environment), or create .env file in the root of project and fill it with actual env variables for docker containers. Don't forget about changing docker-compose.yml config for successfully apply .env file params (parameter env_file) for each service
All application environment variables + below:
G_NUM_OF_WORKERS
- Number of workers on GunicornG_WORKER_TIMEOUT
- Gunicorn worker request timeoutG_WORKER_CONNECTIONS
- Number of connnections per one Gunicorn workerG_PORT
- Port listened by Gunicorn
$ docker-compose up
To rebuilding image to the last code version, you have to:
- Run
docker-compose build
command. Wait for rebuilding. docker-compose up
again to up services with new images.