Library contains django commands which helps to prepare and manage PostgreSQL database.
Project description
Django-psycopg2-extension
Library contains django commands which helps to prepare and manage PostgreSQL database.
Quickstart
Install djjango-psycopg2-extension
pip install django-psycopg2-extension
Add psycopg2_extension to your INSTALLED_APPS
:
INSTALLED_APPS = [
# Django apps...
'psycopg2_extension',
]
Commands
initdb
Django command initdb create a database defined in django settings. If postgres user is not allowed to create database you can define it via --db-url
parameter (format from django-environ)
If you are using some Postgres extenstions you can define it with PSYCOPG2_EXTENSIONS
setting (list of extension names). Command will automatically create it.
cleandb
PostgreSQL database requires often call VACUUM
and REINDEX
. The command cleandb
performs these operations. Again you can specify database or root user with --db-url
parameter.
Command can be configured with these django config settings::
- PSYCOPG2_EXTENSION_EXCLUDE_TABLES - set of excluded tables for cleanup.
- PSYCOPG2_EXTENSION_EXCLUDE_VACUUM_TABLES - set of excluded tables for vacuum command.
- PSYCOPG2_EXTENSION_EXCLUDE_REINDEX_TABLESS - set of excluded tables for reindex command.
- PSYCOPG2_EXTENSION_FULL_VACUUM_TABLES - set of tables where full vacuum will be used.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-psycopg2-extension-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e74a436b81f6760e09df0c1580805007db2f26d01fa99df59babed28cb4b21e7 |
|
MD5 | edea3c239a46269dd390702731b59e38 |
|
BLAKE2b-256 | 82717b3acc94862febf596e8b986e80a337220f540808f4367bb127642c6719e |