This is a docker development environment focused on Python / Django.
A Makefile
is provided, it contains targets for the most common tasks.
It provides a well tested and fully functional development environment for Python / Django projects. It also has some extra features, like:
- HTTPS by default (with valid certificates if you run
make install_certs
). - Commands for creating and restoring backups.
- Commands for managing the containers and images.
Do these only once:
- Add
127.0.0.1 proyecto-django.dev
to your/etc/hosts
. - Run
make certs
. - Run
make install_certs
.
Do these every time you want to work on your project:
- Run
make start
. - Your Django project is ready! Open your browser and go to
https://proyecto-django.dev
.
make start
- Start the development environment (it will start all containers of the project).make stop
- Stop the development environment (it will stop all containers of the project).make restart
- Restart the development environment (it will restart all containers of the project).make delete
- Delete all containers of the project.make migrate
- It will apply all pending migrations.make tests
- It will run the tests.make build
- It will (re)build all images of the project.make build-nocache
- Same asmake build
, but without using cache.make status
- It will show the current status of the containers of the project.make bash
- It will open a bash shell inside Django's container.make shell
- It will open Django's shell/REPL inside the container.make attach
- It will attach to Django's container (useful for debugging).make logs
- It will tail the logs (last 250 lines) of all containers of the project.make delete_images
- It will delete all images of the project.make backup
- It will create a backup of the database inside the./data/backup/
folder.make restore
- It will restore a backup to the database from the./data/backup/
folder.make certs
- It will generate SSL certificates for the NGINX container.make install_certs
- It will install the root CA certs (this is required only if you want the certs generated bymake certs
to be valid)