Metadata-Version: 2.0
Name: django-shared-schema-tenants
Version: 0.0.2
Summary: A lib to help in the creation of shared schema multi tenants applications without suffering
Home-page: https://github.com/hugobessa/django-shared-schema-tenants
Author: Hugo Bessa
Author-email: hugo@bessa.me
License: MIT
Keywords: django-shared-schema-tenants
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Requires-Dist: django-model-utils (>=2.0)

=============================
Django Shared Schema Tenants
=============================

.. image:: https://badge.fury.io/py/django-shared-schema-tenants.svg
    :target: https://badge.fury.io/py/django-shared-schema-tenants

.. image:: https://travis-ci.org/hugobessa/django-shared-schema-tenants.svg?branch=master
    :target: https://travis-ci.org/hugobessa/django-shared-schema-tenants

.. image:: https://codecov.io/gh/hugobessa/django-shared-schema-tenants/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/hugobessa/django-shared-schema-tenants

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`:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'shared_schema_tenants.apps.SharedSchemaTenantsConfig',
        ...
    )

Add Django Shared Schema Tenants's URL patterns:

.. code-block:: python

    from shared_schema_tenants import urls as shared_schema_tenants_urls


    urlpatterns = [
        ...
        url(r'^', include(shared_schema_tenants_urls)),
        ...
    ]


Add TenantMiddleware to your `MIDDLEWARES`:

.. code-block:: python

    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:

*  Cookiecutter_
*  `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage




History
-------

0.1.0 (2017-08-10)
++++++++++++++++++

* First release on PyPI.


