Stores and provides encryption keys for encrypted TV playback
Copy the .env.example
file to .env
and modify the secret values with your own
You can create the Django secret key with:
docker run --rm django python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
On the first run, you have to initialize the database:
docker-compose up -d postgres
docker-compose run --rm --no-deps django python manage.py migrate
docker-compose run --rm --no-deps django python manage.py collectstatic
docker-compose run --rm --no-deps django python manage.py compilemessages
Then start your dev-env with docker-compose up -d
You can either run the tests via PyCharm with the configured run-configurations or do them with docker-compose manually:
docker-compose run -e DJANGO_SETTINGS_MODULE=config.settings.test --rm django pytest
If the tests abort unexpectedly they won't run until the test database is removed. Either recreate the database or run the following command:
docker-compose run --rm django python manage.py drop_test_database
To run the tests, check your test coverage, and generate an HTML coverage report:
docker-compose run -e DJANGO_SETTINGS_MODULE=config.settings.test --rm django coverage run -m pytest
docker-compose run -e DJANGO_SETTINGS_MODULE=config.settings.test --rm django coverage html
open htmlcov/index.html
The project is set up with pre-commit. For it to work, it needs to be outside docker.
To activate it for a project run:
pre-commit install
The next time you commit, it is going to lint and check your files. Sometimes you need to review the changes and do the commit again. If you want to commit without checks
git commit --no-verify
celerybeat
The periodic task schedulerceleryworker
The worker to execute Tasks (mainly importing new data)flower
Task viewer for celerydjango
The APIpostgres
The DBredis
Cache and Celery brokermailhog
Test mailserver
List available commands:
docker-compose run --rm django python manage.py -h
All the commands contain a help (-h/--help
).
To create an superuser account, use this command:
docker-compose run --rm django python manage.py createsuperuser
In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server MailHog
with a web interface is available as docker container.
Container mailhog will start automatically when you will run all docker containers.
Please check cookiecutter-django Docker documentation
_ for more details how to start all containers.
With MailHog running, to view messages that are sent by your application, open your browser and go to http://127.0.0.1:8025