A lib to help in the creation of shared schema multi tenants applications without suffering
Project description
A lib to help in the creation applications with shared schema without suffering
Documentation
The full documentation is at https://django-shared-schema-tenants.readthedocs.io.
Quickstart
Install Django Shared Schema Tenants:
pip install django-shared-schema-tenants
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'shared_schema_tenants.apps.SharedSchemaTenantsConfig',
...
)
Add Django Shared Schema Tenants’s URL patterns:
from shared_schema_tenants import urls as shared_schema_tenants_urls
urlpatterns = [
...
url(r'^', include(shared_schema_tenants_urls)),
...
]
Add TenantMiddleware to your MIDDLEWARES:
MIDDLEWARES = [
# ...
'shared_schema_tenants.middleware.TenantMiddleware',
# ...
]
Features
Tenants synced with django requests: The active tenant can be extracted from the domain of the request and from a specific http header attribute.
Easy data isolation between tenants: You reatrieve and create data the same way you do without tenants. The active tenant can be retreived from the request, and can also be forcedly set.
Partially shared resources: If there are resources that can be accessed from more then one tenant in your applidation, you don’t need to duplicate it.
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Tools used in rendering this package:
History
0.1.0 (2017-08-10)
First release on PyPI.
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
Hashes for django-shared-schema-tenants-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e874e35a4c843058c10fae3b85f31a4a8f15d0987d0d78d612bc813c8fef90d |
|
MD5 | 576ef46a85297ed8c0e36f41d5afb3cc |
|
BLAKE2b-256 | 5e235c28bf08ab43a27779669c7f2041485784f4449ccaa1139eeb6f6d538266 |
Hashes for django_shared_schema_tenants-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b13e36ea8939bf922e60c268878dec5606d8ed9ef3e855431d36a4cbaae445 |
|
MD5 | 0d0438e7d50df4516a03308f9445c40d |
|
BLAKE2b-256 | d967f69da039faec5feeaadba781d75346b13561b115608029bddc8826524ba4 |