Skip to main content

A lib to help in the creation of shared schema multi tenants applications without suffering

Project description

https://badge.fury.io/py/django-shared-schema-tenants.svg https://travis-ci.org/hugobessa/django-shared-schema-tenants.svg?branch=master https://codecov.io/gh/hugobessa/django-shared-schema-tenants/branch/master/graph/badge.svg

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-shared-schema-tenants-0.0.2.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

django_shared_schema_tenants-0.0.2-py2.py3-none-any.whl (21.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-shared-schema-tenants-0.0.2.tar.gz.

File metadata

File hashes

Hashes for django-shared-schema-tenants-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3c6e7b295fdec09f2aff926f59a232ad1010b622c2461a9efbaa5d2060438d90
MD5 e77d69d16292af9d67ef84b0074b0bb9
BLAKE2b-256 4b2af6f162edd71e954019477ebdcdd3c52d099646e9e059f3681a1d9496ce58

See more details on using hashes here.

File details

Details for the file django_shared_schema_tenants-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_shared_schema_tenants-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 194282414cbf1cbe4c49dcd07c1c7c089bc1e46d598c3b728041426436a0f2fd
MD5 c85a68cf92e004a8a6577b9a3879dffb
BLAKE2b-256 2382e8009af75be5723f205965b4b5effa090f578fe3c9b39bbb3eb4e7584f25

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page