Django router for apps with more than 1 database
Project description
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',
...
]
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
License
Copyright © 2019, Piotr Roszatycki
This software is distributed under the GNU Lesser General Public License (LGPL 3 or greater).
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
Close
Hashes for django-database-for-apps-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88affd2e5f0fa4228055987f8a000fcc5a1525c6da32faec6d627929f3b34e02 |
|
MD5 | f833409b673b81803a85d29091e9e3f7 |
|
BLAKE2b-256 | efe5dbe72f8e65f5003fe80abaf3bada52d7976f673b20b74df51395cef0e59a |
Close
Hashes for django_database_for_apps-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 934c5154020c117d6d5b63a381197ebc9dcc73d58c819304031fefe1454441af |
|
MD5 | 46c9aba796a15fb96e83b33d2d32e36e |
|
BLAKE2b-256 | 3e99d674a7d7f2e2c936469e51380c2907bd4d17f99b77bf4b1178032472802d |