Skip to main content

Django Shared Schema Tenants

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 retrieve and create data the same way you do without tenants. The active tenant can be retrieved from the request, and can also be forcedly set.

  • Partially shared data: If there is data 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.

Metadata

Release files for django-shared-schema-tenants 0.1.0

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-shared-schema-tenants 0.1.0
File Size Uploaded Provenance
django-shared-schema-tenants-0.1.0.tar.gz 16.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-shared-schema-tenants 0.1.0
File Interpreter ABI Platform
django_shared_schema_tenants-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 38.2 kB

Release files / django-shared-schema-tenants-0.1.0.tar.gz

Download URL django-shared-schema-tenants-0.1.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8e390be390ae2df1fb8089091e733c49318f6f9b4a9be6e8ea330d285aad7778
BLAKE2b-256 checksum
How to use checksums
0457b709db76d31ec095156732a46bc3caaf47fcfe754bb987cbc9a3ffc0c700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_shared_schema_tenants-0.1.0-py2.py3-none-any.whl

Download URL django_shared_schema_tenants-0.1.0-py2.py3-none-any.whl
Size 22.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b6cd6530e4e0817f4733ea84a1f19d0c501f1de51c666efd298fdb76944c4ff0
BLAKE2b-256 checksum
How to use checksums
6f7c8de8adad4f1c25914351575970d54dbbfeee34e1a95cd03ffdc5b43cd35c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-shared-schema-tenants 0.1.0

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