django-postgres-extra
aims to make all of PostgreSQL's awesome features available through the Django ORM. We do this by taking care of all the hassle. As opposed to the many small packages that are available to try to bring a single feature to Django with minimal effort, django-postgres-extra
goes the extra mile with well tested implementations, seamless migrations and much more.
By seamless, we mean that any features we add will work truly seamlessly. You should not have to manually modify your migrations to work with fields and objects provided by this package.
Features
Explore the documentation to learn about all features:
Installation
-
Install the package from PyPi:
$ pip install django-postgres-extra
-
Add
psqlextra
anddjango.contrib.postgres
to yourINSTALLED_APPS
:INSTALLED_APPS = [ .... 'django.contrib.postgres', 'psqlextra' ]
-
Set the database engine to
psqlextra.backend
:DATABASES = { 'default': { ... 'ENGINE': 'psqlextra.backend' } }
-
Make sure all models inherit from
psqlextra.models.PostgresModel
or use thepsqlextra.manager.PostgresManager
. Without this, most features do not work. -
Read the documentation about the custom database engine to avoid common pitfalls: Database engine .
Requirements
In order to use this package, your project must be using:
- Python 3.5, or newer
- PostgreSQL 9.6 or newer
- Django 1.10 or newer
Python 3.5 is required because type hints are used. A feature only available in Python 3.5 and newer. PostgreSQL 9.6 is required to take advantage of the latest features such as ltree
.