A backend for Django and Postgres that sets up a readonly connection
Project description
A readonly database backend for Django and PostgreSQL. It does this by setting the connection to “readonly”.
Usage
To configure a read-only database connection, add an entry to your DATABASES setting that uses django_postgres_readonly as the engine:
DATABASES = { 'default': { 'NAME': 'my_django_db', 'ENGINE': 'django.db.backends.postgresql', 'USER': 'my_db_user', 'PASSWORD': 'my_password' }, 'readonly': { 'NAME': 'my_django_db', 'ENGINE': 'django_postgres_readonly', 'USER': 'my_db_user', 'PASSWORD': 'my_password' } }
Caveats
This backend is not meant to provide security against willful bad actors. Its main reason of existence is to protect you against your own mistakes.
If you need secure way for read-only connections, you should probably look into creating a separate user and grant it SELECT rights only.
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
Built Distribution
File details
Details for the file django-postgres-readonly-1.0.0.tar.gz
.
File metadata
- Download URL: django-postgres-readonly-1.0.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 198eef0319f72225c23786203c4520a3a249bb4d83bd9066b2ac1c550073433c |
|
MD5 | ee96e93b4c9d4b7fa40ee5e11ab19ab2 |
|
BLAKE2b-256 | 53bed210ccece0088aec806d209afa80249cce953b007909421091a30fdf8cdc |
File details
Details for the file django_postgres_readonly-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_postgres_readonly-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 114e158ca38a157b7453d614aa9a9fd82646f0b5a91bbe0a496c4b3a1a852dfc |
|
MD5 | 45d705d33ffe9791a478f16e13b434db |
|
BLAKE2b-256 | a5fa99acbc56aae92cf9d1b48da42a6685178c4b90a62cdcf5e677728f8255de |