DjanDo is a light-weight command-line interface for interacting with Django in a Docker development environment.
$ pip install djandoIn a Django root folder project run:
$ djando initThis command will add the following files to your project:
youproject/
| ...
| runtimes/
| docker-compose.yml
| ...
After that, start the container:
$ djando upNote: when running
djando upfirst time DjanDo will try to create avenvfolder and install dependencies fromrequirements.txt
DjanDo will load all environment variables (needed for docker-compose.yml) from a .env file at the root project folder.
DjanDo proxy commands to docker-compose. For example:
$ djando manage runserverWill be proxyed to
$ docker-compose exec -u djando django.test python manage.py runserverList of all proxyed commands:
| Command | Proxyed Command | Example |
|---|---|---|
| python | python | djando python --version |
| pip | pip | djando pip install -r requirements.txt |
| django-admin | django-admin | djando django-admin check |
| manage | python manage.py | djando manage runserver |
| psql | PGPASSWORD=${PGPASSWORD} psql -U ${POSTGRES_USER} ${POSTGRES_DB} | djando psql |
| shell or bash | bash | djando bash |
| root-shell | bash (root user) | djando root-shell |
Any other command will be passed to docker-compose directly, for example:
$ djando up # will be proxyed to docker-compose up
$ djando up -d # will be proxyed to docker-compose up -d
$ djando down # will be proxyed to docker-compose down
$ djando ps # will be proxyed to docker-compose ps