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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca41d4998f8667bb4050307dcd62e00f479a6dced371fa32fd48c1091601646b |
|
MD5 | 3ab0a1e9ac32f997ef3cb1d5ec507bd5 |
|
BLAKE2b-256 | 5eccfa11f78b923185bf74556e1bd279333945179642acc8a2b8e63c561c50c0 |