Skip to main content

Django pg8000

A Django database backend for the pg8000 driver for PostgreSQL.

Workflow Status Badge

Installation And Usage

Install with: pip install django_pg8000

Set the Django DATABASES to something like:

DATABASES = {
    "default": {
        "ENGINE": "django_pg8000",
        "HOST": "localhost",
        "PORT": 5432,
        "NAME": "django",
        "USER": "postgres",
        "OPTIONS": {},
    },
}

Contributing

At the moment Django pg8000 doesn't pass all of the tests, so if you'd like to contribute, please send a Pull Request that fixes a particular test.

Testing

  • git clone https://github.com/django/django.git
  • cd tests
  • python -m pip install -e ..
  • python -m pip install -r requirements/py3.txt
  • ./runtests.py databases

This will run the standard tests against the SQLite backend.

Create a file at django/django/conf/test_pg8000.py:

DATABASES = {
    "default": {
        "ENGINE": "django_pg8000",
        "HOST": "localhost",
        "PORT": 5432,
        "NAME": "django",
        "USER": "postgres",
        "OPTIONS": {},
    },
    "other": {
        "ENGINE": "django_pg8000",
        "HOST": "localhost",
        "PORT": 5432,
        "NAME": "django_other",
        "USER": "postgres",
        "OPTIONS": {},
    },
}

SECRET_KEY = "django_tests_secret_key"

# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = [
    "django.contrib.auth.hashers.MD5PasswordHasher",
]

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

USE_TZ = False

Then run ./runtests.py --failfast --parallel=1 --exclude-tag=psycopg_specific --settings=django.conf.test_pg8000

Some tests in the Django suite are specific to the pyscopg driver, so these can be marked with the psycopg_specific tag.

If tests fail then you may need to drop the databases that are left hanging around by doing something like: psql --username=postgres -c "DROP DATABASE IF EXISTS test_django;" -c "DROP DATABASE IF EXISTS test_django_other;"

Doing A Release Of Django pg8000

  • git tag -a x.y.z -m "version x.y.z"
  • rm -r dist
  • python -m build
  • twine upload dist/*

Release Notes

Version 0.0.5

  • Now requires pg8000 1.30.4 or higher

Version 0.0.4

  • Various bug fixes, so a few more tests are passed.

Version 0.0.3

  • Rather than using the vendor 'postgresql', use 'postgresql_pg8000'. Otherwise Django assumes that psycopg is installed.

Version 0.0.2

  • Add GitHub Actions tests

Version 0.0.1

  • Initial release.

Metadata

Release files for django-pg8000 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-pg8000 0.0.5
File Size Uploaded
django_pg8000-0.0.5.tar.gz 25.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-pg8000 0.0.5
File Interpreter ABI Platform
django_pg8000-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 53.0 kB

Release files / django_pg8000-0.0.5.tar.gz

Download URL django_pg8000-0.0.5.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dff41d1618c6b58a4d973d221c3075fa0eb06188ae90c37988069ade630e1a3d
BLAKE2b-256 checksum
How to use checksums
b079d188341767b1aac57a6bad6e5402fc5e90ae58bc83308943efc0d72fdf5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / django_pg8000-0.0.5-py3-none-any.whl

Download URL django_pg8000-0.0.5-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f21aa1f0540a1435588287540122454a79f76220bcd82e64094fc97c1a30c888
BLAKE2b-256 checksum
How to use checksums
4f543fd65a752270db87d71793c4bb97352d3523135351bfbd01ce3959ba6b2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page