How to interact with your application's database
The database for your Divio application runs:
- in a Docker container for your local applications: Interact with the local database
- on a dedicated cluster for your cloud-deployed sites: Interact with the Cloud database
In either case, you will mostly only need to interact with the database using the tools provided by your application's runtime stack (e.g. Django). However, if you need to interact with it directly, the option exists.
The database service name in
docker-compose.yml
The Divio CLI expects that the database service will be named database_default
(or db
) in your
docker-compose.yml
file. If not, it certain commands (such as divio app push/pull db
) will fail.
Interact with the local database
Generally, the most convenient way to interact with the application's database is to do it locally (with a local copy of your cloud data if necessary).
From the application's local Django web container
Using dbshell
Run:
docker-compose run --rm web python ./manage.py dbshell