Skip to main content
django_db_prefix
================

Project goal
------------

Allow specification of a global database table name prefix.

Reason for the project
----------------------

1. Some (external) projects automatically use a database prefix for
interaction with a database. This is particularly common in implementations
of the Active Record pattern.

2. It is possible to define an explicit database table name in the Meta
class on a model; however, this is not as easily accomplished when dealing
with a third-party application. By providing a high-level interface for
adding prefixes there is a simple, consistent way to achieve this goal other
than forking the code or ad-hoc monkey patching.

Installation
------------

1. Install using pip:

pip install django-db-prefix

2. Add django_db_prefix at the top of your INSTALLED_APPS list. It is
recommended that django_db_prefix is the first listed application, but it
is essential that it be loaded before the initialization of any model you
expect to be modified.

INSTALLED_APPS = ['django_db_prefix',] + INSTALLED_APPS

Configuration
-------------


Global Prefix
=============

To add a common prefix to all models simply set `DB_PREFIX` to the string that
you want to be prepended.

DB_PREFIX = "foo_"

For example, for the model bar_app.models.Baz the default table would be:
`bar_app_baz`

By setting `DB_PREFIX` to `foo_`, the table would be `foo_bar_app_baz`.

Metadata

Release files for django-db-prefix 1.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-db-prefix 1.0.5
File Size Uploaded Provenance
django-db-prefix-1.0.5.tar.gz 2.1 kB Without provenance Details

Release files / django-db-prefix-1.0.5.tar.gz

Download URL django-db-prefix-1.0.5.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba9fa8bfecd44838f8c4e6ed9650057dcde8067d833c0f869ec112af58bd9bb
BLAKE2b-256 checksum
How to use checksums
f9eea5c4d94465869b853ce3973f20be5f0804a865252e8dd2cf6503682d7145
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-db-prefix 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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