Skip to main content
https://img.shields.io/pypi/v/django-database-for-apps.svg https://travis-ci.org/dex4er/django-database-for-apps.svg?branch=master https://readthedocs.org/projects/django-database-for-apps/badge/?version=latest https://img.shields.io/pypi/pyversions/django-database-for-apps.svg https://img.shields.io/pypi/djversions/django-database-for-apps.svg

django-database-for-apps

django-database-for-apps is a package that provides a router which chooses a database based on app name.

Installation

Install with pip or pipenv:

pip install django-database-for-apps

Add django_database_for_apps to your installed apps in your settings.py file:

INSTALLED_APPS = [
    'django_database_for_apps',
    ...
]

Configure DB routers:

DATABASE_ROUTERS = [
    'django_database_for_apps.Router'
]

Configuration

# list of apps and theirs database
DATABASE_FOR_APPS = {
    'test_project': 'default',
    '*': 'django',
}

* matches all applications so the default database might be redefined from 'default' to something else.

Optional

# allows relations between databases (default: None)
DATABASE_FOR_APPS_RELATIONS = True

Documentation

See http://django-database-for-apps.readthedocs.org/

License

Copyright © 2019, Piotr Roszatycki

This software is distributed under the GNU Lesser General Public License (LGPL 3 or greater).

Metadata

Release files for django-database-for-apps 0.1.1

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-database-for-apps 0.1.1
File Size Uploaded Provenance
django-database-for-apps-0.1.1.tar.gz 16.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-database-for-apps 0.1.1
File Interpreter ABI Platform
django_database_for_apps-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 22.3 kB

Release files / django-database-for-apps-0.1.1.tar.gz

Download URL django-database-for-apps-0.1.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
909352dffd3eb07a52fb002a2e5ac037c646e5b6a0e2d9194556945d92407465
BLAKE2b-256 checksum
How to use checksums
e37477ad22f96bbe31e4875c69a2f5ca9a5846af9bfd2d9272c1541831a16e07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3

Release files / django_database_for_apps-0.1.1-py2.py3-none-any.whl

Download URL django_database_for_apps-0.1.1-py2.py3-none-any.whl
Size 5.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d5137da047028832e7cb69efcf9ed2694c8f0d04c341b33121d1c83c8259c901
BLAKE2b-256 checksum
How to use checksums
1ba6793a1cf4df14ece02057d70dae558336270b730705735229a224bb22917e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3

Security for django-database-for-apps 0.1.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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