Metadata-Version: 2.5
Name: vinta-django-orgs
Version: 0.4.0
Summary: A lib to help in the creation of shared schema multi organization applications without suffering
Project-URL: Homepage, https://github.com/vintasoftware/vinta-django-orgs
Project-URL: Documentation, https://vinta-django-orgs.readthedocs.io
Project-URL: Source, https://github.com/vintasoftware/vinta-django-orgs
Author-email: Hugo Bessa <hugo@vinta.com.br>
License-Expression: MIT
License-File: LICENSE
Keywords: vinta-django-orgs
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: <3.16,>=3.11
Requires-Dist: django-model-utils>=5.0
Requires-Dist: django<6.3,>=5.2
Requires-Dist: djangorestframework>=3.16
Description-Content-Type: text/x-rst

=================
Vinta Django Orgs
=================

.. image:: https://badge.fury.io/py/vinta-django-orgs.svg
    :target: https://badge.fury.io/py/vinta-django-orgs

.. image:: https://github.com/hugobessa/django-shared-schema-organizations/actions/workflows/ci.yml/badge.svg
    :target: https://github.com/vintasoftware/vinta-django-orgs/actions/workflows/ci.yml

.. image:: https://codecov.io/gh/hugobessa/django-shared-schema-organizations/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/vintasoftware/vinta-django-orgs

A lib to help in the creation applications with shared schema without suffering

Documentation
-------------

The full documentation is at [ReadTheDocs](https://vinta-django-orgs.readthedocs.io).

Quickstart
----------

Install Django Shared Schema Organizations::

    pip install vinta-django-orgs

Add it to your `INSTALLED_APPS`:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'vinta_orgs.apps.OrganizationsConfig',
        ...
    )

Add Django Shared Schema Organizations's URL patterns:

.. code-block:: python

    from django.urls import include, path


    urlpatterns = [
        ...
        path('', include('vinta_orgs.urls')),
        ...
    ]


Add OrganizationMiddleware to your `MIDDLEWARES`:

.. code-block:: python

    MIDDLEWARES = [
        # ...
        'vinta_orgs.middleware.OrganizationMiddleware',
        # ...
    ]


Features
--------

* **Organizations synced with django requests:** The active organization can be extracted from the domain of the request and from a specific http header attribute.
* **Easy data isolation between organizations:** You retrieve and create data the same way you do without organizations. The active organization 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 organization in your applidation, you don't need to duplicate it.


Running Tests
-------------

Does the code actually work?

::

    $ uv sync
    $ uv run tox
