Skip to main content

drop postgres database

Project description

Installation

$ [sudo] pip install django-postgres-dropdb

Commands

command help
python manage.py dropdb drop postgres database

Executable modules

usage __doc__
python -m django_postgres_dropdb [alias] drop postgres database

Examples

example 1 - management command:

settings.py

INSTALLED_APPS+=['django_postgres_dropdb']

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': os.getenv('DB_NAME'),
        'USER': os.getenv('DB_USER'),
        'PASSWORD': os.getenv('DB_PASS'),
        'HOST': os.getenv('DB_HOST'),
        'PORT': os.getenv('DB_PORT'),
    }
}
$ python manage.py dropdb
$ python manage.py dropdb "default"

example 2 - python module cli:

settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': os.getenv('DB_NAME'),
        'USER': os.getenv('DB_USER'),
        'PASSWORD': os.getenv('DB_PASS'),
        'HOST': os.getenv('DB_HOST'),
        'PORT': os.getenv('DB_PORT'),
    }
}
$ export DJANGO_SETTINGS_MODULE=settings
$ python -m django_postgres_dropdb
$ python -m django_postgres_dropdb "default"

Related projects

django-readme-generator

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-postgres-dropdb, version 2019.8.24
Filename, size File type Python version Upload date Hashes
Filename, size django-postgres-dropdb-2019.8.24.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page