Skip to main content

Create and start MySQL/PostgreSQL containers with a single management command

Project description

Create and start MySQL/PostgreSQL containers with a single management command.

  • If an image isn’t available, it will be pulled.
  • If a container with the specified configuration doesn’t exist, it will be created.
  • If a container is not running, it will be started.

Necessary settings are taken from

  • SQLite databases are ignored.
  • For MySQL and PostgreSQL, one container is created per database.

Also, Docker settings are picked up from standard DOCKER_* environment variables.


./ db_quick_setup

'db_quick_setup' should be added to INSTALLED_APPS:


'HOST' in database settings should point to Docker hostname/IP. You can use find_docker_host() to auto-detect it.

from db_quick_setup import find_docker_host

    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mysql_db',
        'USER': 'mysql_db',
        'PASSWORD': 'mysql_db_pass',
        'HOST': find_docker_host(),
        'PORT': 53308

'NAME', 'USER', 'PASSWORD' and 'PORT' can have arbitrary values, the container will be configured accordingly.

  • For MySQL 'NAME' and 'USER' should have the same value, it’s a limitation of the official image.


DOCKER_MYSQL_IMAGE: Docker image to use for MySQL databases. Default is the official image - mysql:latest.

DOCKER_POSTGRES_IMAGE: Docker image for PostgreSQL databases. Default is the official image - postgresql:latest.

DOCKER_ASSERT_HOSTNAME: enable SSL hostname validation (boolean). True by default.

DOCKER_PRIVILEGED: create privileged containers. Currently used as a workaround for permission problems on Travis CI. It is disabled by default, and shouldn’t be enabled usually.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-db-quick-setup, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size django-db-quick-setup-0.0.2.tar.gz (8.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page