eox-tenant


Nameeox-tenant JSON
Version 13.0.0 PyPI version JSON
download
home_pageNone
SummaryEdunext Open edx extensions tenant.
upload_time2025-01-27 13:21:38
maintainerNone
docs_urlNone
authoreduNEXT
requires_pythonNone
licenseAGPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==========
EOX Tenant
==========
|Maintainance Badge| |Test Badge| |PyPI Badge|

.. |Maintainance Badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
   :alt: Maintainance Status
.. |Test Badge| image:: https://img.shields.io/github/actions/workflow/status/edunext/eox-tenant/.github%2Fworkflows%2Ftests.yml?label=Test
   :alt: GitHub Actions Workflow Test Status
.. |PyPI Badge| image:: https://img.shields.io/pypi/v/eox-tenant?label=PyPI
   :alt: PyPI - Version

Eox-tenant is a plugin for `Open edX`_, and part of the Edunext Open edX Extensions (aka EOX), that replaces the microsites and site_configurations features, offering a more robust multi-tenancy model.

If you are looking for professional development or support with multitenancy or multi-sites in the Open edX platform, you can reach out to sales@edunext.co

.. _Open edX: https://github.com/openedx/edx-platform/

Installation
============

#. Add this plugin in your Tutor ``config.yml`` with the ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` setting.

   .. code-block:: yaml

      OPENEDX_EXTRA_PIP_REQUIREMENTS:
         - eox-tenant=={{version}}

#. Save the configuration with ``tutor config save``.
#. Build the image and launch your platform with ``tutor local launch``.

Usage
=====

Once your instance is running, you can access the Django admin site and locate the ``EDUNEXT OPENEDX MULTITENANCY`` models.

- **Microsites:** Store the microsite configuration.
- **Routes:** Configure the URL for a tenant.
- **Tenant configs:** Store the configuration for each tenant.
- **Tenant organizations:** Link each organization with one or multiple tenants.

Add ``EDNX_USE_SIGNAL = True`` in each microsite/tenant that wants to use the plugin. 

Compatibility Notes
--------------------

+------------------+------------------+
| Open edX Release | Version          |
+==================+==================+
| Ironwood         | < 3.0            |
+------------------+------------------+
| Juniper          | >= 3.0 < 4.0     |
+------------------+------------------+
| Koa              | >= 4.0 <= 5.1.3  |
+------------------+------------------+
| Lilac            | >= 4.0 < 6.2     |
+------------------+------------------+
| Maple            | >= 6.0 < 12.0    |
+------------------+------------------+
| Nutmeg           | >= 6.2 < 12.0    |
+------------------+------------------+
| Olive            | >= 8.0 < 12.0    |
+------------------+------------------+
| Palm             | >= v11.7.0 < 12.0|
+------------------+------------------+
| Quince           | >= v11.7.0 < 13.0|
+------------------+------------------+
| Redwood          | >= v11.7.0       |
+------------------+------------------+
| Sumac            | >= v12.1.0       |
+------------------+------------------+

⚠️ Since the 6.2 version, eox-tenant does not support Django 2.2

The plugin is configured for the latest release (Redwood). The following changes in the plugin settings should be applied to be used for previous releases.

**Maple**

For version  11.X compatible

.. code-block:: yaml

  EOX_TENANT_EDX_AUTH_BACKEND = "eox_tenant.edxapp_wrapper.backends.edx_auth_i_v1"

Those settings can be changed in ``eox_tenant/settings/common.py`` or, for example, in the instance settings.

🚨 If the release you are looking for is not listed, please note:

- If the Open edX release is compatible with the current eox-tenant version (see `Compatibility Notes <https://github.com/eduNEXT/eox-tenant?tab=readme-ov-file#compatibility-notes>`_), the default configuration is sufficient.
- If incompatible, you can refer to the README from the relevant version tag for configuration details (e.g., `v6.2.0 README <https://github.com/eduNEXT/eox-tenant/blob/v6.2.0/README.rst>`_).

🚨 For version < 10.0.0 you need to enable eox-tenant adding in the LMS configuration:

.. code-block:: yaml

  USE_EOX_TENANT = True

Commands
--------

Synchronize Organizations
^^^^^^^^^^^^^^^^^^^^^^^^^

This command will synchronize the course_org_filter values in lms_configs(TenantConfig model) or values(Microsite model) with the TenantOrganization registers if the organization does not exist, it will be created, otherwise, it will be added to the organizations model field.


.. code-block:: bash

  ./manage.py lms synchronize_organizations  # only for TenantConfig and Microsite
  ./manage.py lms synchronize_organizations --model TenantConfig # only for TenantConfig
  ./manage.py lms synchronize_organizations --model Microsite # only for Microsite

Create/Edit tenant configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`create_or_update_tenant_config` helps to add or edit ``TenantConfig`` and linked ``Routes`` via command line.

.. code-block:: bash

  # This command will create/edit an entry in TenantConfig with external_key lacolhost.com and update its JSONField(s) with passed JSON content.
  ./manage.py lms create_or_update_tenant_config --external-key lacolhost.com --config '{"lms_configs": {"PLATFORM_NAME": "Lacolhost"}, "studio_configs": {"PLATFORM_NAME": "Lacolhost"}}' lacolhost.com studio.lacolhost.com preview.lacolhost.com

  # This command will create/edit an entry in TenantConfig with external_key lacolhost.com and update its JSONField(s) with passed JSON config file content.
  ./manage.py lms create_or_update_tenant_config --external-key lacolhost.com --config-file /tmp/some.json lacolhost.com studio.lacolhost.com preview.lacolhost.com

  # Same as above, but it will override configuration instead of updating it.
  ./manage.py lms create_or_update_tenant_config --external-key lacolhost.com --config-file /tmp/some.json lacolhost.com studio.lacolhost.com preview.lacolhost.com --override


Migration notes
===============

**Migrating from 0.* version to 1.0.0**

From version **1.0.0**, **RedirectionsMiddleware** and **PathRedirectionMiddleware** are no longer supported in this plugin. These middleware were moved to the **eox-core** plugin `here <https://github.com/eduNEXT/eox-core/>`_. From this, you can have three cases:


#. You have already installed eox-core alongside eox-tenant. In this case, you need to:

   * Upgrade eox-core to version **2.0.0** (previous releases are not compatible with eox-tenant 1.0.0)
   * Run the plugin migrations as indicated below:

   .. code-block:: bash

     ./manage.py lms migrate eox_tenant --settings=<your app settings>
     ./manage.py lms migrate eox_core --fake-initial --settings=<your app settings>


#. You only have installed eox-tenant and you want to keep the functionality that middleware offer. You need to:

   * Install eox-core version **2.0.0** as edx-platform requirement. You can use *Ansible* to add this plugin as an extra requirement.

   * Run the plugin migrations as indicated below:

   .. code-block:: bash

     ./manage.py lms migrate eox_tenant --settings=<your app settings>
     ./manage.py manage.py lms migrate eox_core --fake-initial --settings=<your app settings>


#. In the case you are not using the redirection middleware, and only have eox-tenant installed, you can simply apply the database migrations for the eox-tenant plugin:

   .. code-block:: bash

     ./manage.py manage.py lms migrate eox_tenant --settings=<your app settings>

   The table corresponding to the Redirection model will not be deleted but it will be discarded from the Django state

Caveats
-------

- SSO that uses the LMS while authenticating does so with server-to-server communication. Therefore, when the `AvailableScreenMiddleware` gets the current domain, it finds that `lms:8000` as in `SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT` which does not exist, then raises a 404 exception. To avoid this error, set in your LMS settings file:

.. code-block:: python

  SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT

How to Contribute
=================

Contributions are welcome! See our `CONTRIBUTING`_ file for more
information – it also contains guidelines for how to maintain high code
quality, which will make your contribution more likely to be accepted.

.. _CONTRIBUTING: https://github.com/eduNEXT/eox-tenant/blob/master/CONTRIBUTING.rst

License
=======

This project is licensed under the AGPL-3.0 License. See the `LICENSE <LICENSE.txt>`_ file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "eox-tenant",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "eduNEXT",
    "author_email": "contact@edunext.co",
    "download_url": "https://files.pythonhosted.org/packages/af/ca/da3cf7ee9c326979c01aa142be8e869c5ce1a4dae319c09fe147066cbfbd/eox_tenant-13.0.0.tar.gz",
    "platform": null,
    "description": "==========\nEOX Tenant\n==========\n|Maintainance Badge| |Test Badge| |PyPI Badge|\n\n.. |Maintainance Badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen\n   :alt: Maintainance Status\n.. |Test Badge| image:: https://img.shields.io/github/actions/workflow/status/edunext/eox-tenant/.github%2Fworkflows%2Ftests.yml?label=Test\n   :alt: GitHub Actions Workflow Test Status\n.. |PyPI Badge| image:: https://img.shields.io/pypi/v/eox-tenant?label=PyPI\n   :alt: PyPI - Version\n\nEox-tenant is a plugin for `Open edX`_, and part of the Edunext Open edX Extensions (aka EOX), that replaces the microsites and site_configurations features, offering a more robust multi-tenancy model.\n\nIf you are looking for professional development or support with multitenancy or multi-sites in the Open edX platform, you can reach out to sales@edunext.co\n\n.. _Open edX: https://github.com/openedx/edx-platform/\n\nInstallation\n============\n\n#. Add this plugin in your Tutor ``config.yml`` with the ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` setting.\n\n   .. code-block:: yaml\n\n      OPENEDX_EXTRA_PIP_REQUIREMENTS:\n         - eox-tenant=={{version}}\n\n#. Save the configuration with ``tutor config save``.\n#. Build the image and launch your platform with ``tutor local launch``.\n\nUsage\n=====\n\nOnce your instance is running, you can access the Django admin site and locate the ``EDUNEXT OPENEDX MULTITENANCY`` models.\n\n- **Microsites:** Store the microsite configuration.\n- **Routes:** Configure the URL for a tenant.\n- **Tenant configs:** Store the configuration for each tenant.\n- **Tenant organizations:** Link each organization with one or multiple tenants.\n\nAdd ``EDNX_USE_SIGNAL = True`` in each microsite/tenant that wants to use the plugin. \n\nCompatibility Notes\n--------------------\n\n+------------------+------------------+\n| Open edX Release | Version          |\n+==================+==================+\n| Ironwood         | < 3.0            |\n+------------------+------------------+\n| Juniper          | >= 3.0 < 4.0     |\n+------------------+------------------+\n| Koa              | >= 4.0 <= 5.1.3  |\n+------------------+------------------+\n| Lilac            | >= 4.0 < 6.2     |\n+------------------+------------------+\n| Maple            | >= 6.0 < 12.0    |\n+------------------+------------------+\n| Nutmeg           | >= 6.2 < 12.0    |\n+------------------+------------------+\n| Olive            | >= 8.0 < 12.0    |\n+------------------+------------------+\n| Palm             | >= v11.7.0 < 12.0|\n+------------------+------------------+\n| Quince           | >= v11.7.0 < 13.0|\n+------------------+------------------+\n| Redwood          | >= v11.7.0       |\n+------------------+------------------+\n| Sumac            | >= v12.1.0       |\n+------------------+------------------+\n\n\u26a0\ufe0f Since the 6.2 version, eox-tenant does not support Django 2.2\n\nThe plugin is configured for the latest release (Redwood). The following changes in the plugin settings should be applied to be used for previous releases.\n\n**Maple**\n\nFor version  11.X compatible\n\n.. code-block:: yaml\n\n  EOX_TENANT_EDX_AUTH_BACKEND = \"eox_tenant.edxapp_wrapper.backends.edx_auth_i_v1\"\n\nThose settings can be changed in ``eox_tenant/settings/common.py`` or, for example, in the instance settings.\n\n\ud83d\udea8 If the release you are looking for is not listed, please note:\n\n- If the Open edX release is compatible with the current eox-tenant version (see `Compatibility Notes <https://github.com/eduNEXT/eox-tenant?tab=readme-ov-file#compatibility-notes>`_), the default configuration is sufficient.\n- If incompatible, you can refer to the README from the relevant version tag for configuration details (e.g., `v6.2.0 README <https://github.com/eduNEXT/eox-tenant/blob/v6.2.0/README.rst>`_).\n\n\ud83d\udea8 For version < 10.0.0 you need to enable eox-tenant adding in the LMS configuration:\n\n.. code-block:: yaml\n\n  USE_EOX_TENANT = True\n\nCommands\n--------\n\nSynchronize Organizations\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThis command will synchronize the course_org_filter values in lms_configs(TenantConfig model) or values(Microsite model) with the TenantOrganization registers if the organization does not exist, it will be created, otherwise, it will be added to the organizations model field.\n\n\n.. code-block:: bash\n\n  ./manage.py lms synchronize_organizations  # only for TenantConfig and Microsite\n  ./manage.py lms synchronize_organizations --model TenantConfig # only for TenantConfig\n  ./manage.py lms synchronize_organizations --model Microsite # only for Microsite\n\nCreate/Edit tenant configuration\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`create_or_update_tenant_config` helps to add or edit ``TenantConfig`` and linked ``Routes`` via command line.\n\n.. code-block:: bash\n\n  # This command will create/edit an entry in TenantConfig with external_key lacolhost.com and update its JSONField(s) with passed JSON content.\n  ./manage.py lms create_or_update_tenant_config --external-key lacolhost.com --config '{\"lms_configs\": {\"PLATFORM_NAME\": \"Lacolhost\"}, \"studio_configs\": {\"PLATFORM_NAME\": \"Lacolhost\"}}' lacolhost.com studio.lacolhost.com preview.lacolhost.com\n\n  # This command will create/edit an entry in TenantConfig with external_key lacolhost.com and update its JSONField(s) with passed JSON config file content.\n  ./manage.py lms create_or_update_tenant_config --external-key lacolhost.com --config-file /tmp/some.json lacolhost.com studio.lacolhost.com preview.lacolhost.com\n\n  # Same as above, but it will override configuration instead of updating it.\n  ./manage.py lms create_or_update_tenant_config --external-key lacolhost.com --config-file /tmp/some.json lacolhost.com studio.lacolhost.com preview.lacolhost.com --override\n\n\nMigration notes\n===============\n\n**Migrating from 0.* version to 1.0.0**\n\nFrom version **1.0.0**, **RedirectionsMiddleware** and **PathRedirectionMiddleware** are no longer supported in this plugin. These middleware were moved to the **eox-core** plugin `here <https://github.com/eduNEXT/eox-core/>`_. From this, you can have three cases:\n\n\n#. You have already installed eox-core alongside eox-tenant. In this case, you need to:\n\n   * Upgrade eox-core to version **2.0.0** (previous releases are not compatible with eox-tenant 1.0.0)\n   * Run the plugin migrations as indicated below:\n\n   .. code-block:: bash\n\n     ./manage.py lms migrate eox_tenant --settings=<your app settings>\n     ./manage.py lms migrate eox_core --fake-initial --settings=<your app settings>\n\n\n#. You only have installed eox-tenant and you want to keep the functionality that middleware offer. You need to:\n\n   * Install eox-core version **2.0.0** as edx-platform requirement. You can use *Ansible* to add this plugin as an extra requirement.\n\n   * Run the plugin migrations as indicated below:\n\n   .. code-block:: bash\n\n     ./manage.py lms migrate eox_tenant --settings=<your app settings>\n     ./manage.py manage.py lms migrate eox_core --fake-initial --settings=<your app settings>\n\n\n#. In the case you are not using the redirection middleware, and only have eox-tenant installed, you can simply apply the database migrations for the eox-tenant plugin:\n\n   .. code-block:: bash\n\n     ./manage.py manage.py lms migrate eox_tenant --settings=<your app settings>\n\n   The table corresponding to the Redirection model will not be deleted but it will be discarded from the Django state\n\nCaveats\n-------\n\n- SSO that uses the LMS while authenticating does so with server-to-server communication. Therefore, when the `AvailableScreenMiddleware` gets the current domain, it finds that `lms:8000` as in `SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT` which does not exist, then raises a 404 exception. To avoid this error, set in your LMS settings file:\n\n.. code-block:: python\n\n  SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT\n\nHow to Contribute\n=================\n\nContributions are welcome! See our `CONTRIBUTING`_ file for more\ninformation \u2013 it also contains guidelines for how to maintain high code\nquality, which will make your contribution more likely to be accepted.\n\n.. _CONTRIBUTING: https://github.com/eduNEXT/eox-tenant/blob/master/CONTRIBUTING.rst\n\nLicense\n=======\n\nThis project is licensed under the AGPL-3.0 License. See the `LICENSE <LICENSE.txt>`_ file for details.\n",
    "bugtrack_url": null,
    "license": "AGPL",
    "summary": "Edunext Open edx extensions tenant.",
    "version": "13.0.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5662749a770998c0fc5dcc42f93e8cd822e7f6cee4ced21962bbc76ca7561785",
                "md5": "231e49afe7aec4d6707215bfbf36c56f",
                "sha256": "ad0e3da2d29eba79c925f69069e9b930cfd007ced34028977b77ac5a72936d68"
            },
            "downloads": -1,
            "filename": "eox_tenant-13.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "231e49afe7aec4d6707215bfbf36c56f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 102837,
            "upload_time": "2025-01-27T13:21:36",
            "upload_time_iso_8601": "2025-01-27T13:21:36.085881Z",
            "url": "https://files.pythonhosted.org/packages/56/62/749a770998c0fc5dcc42f93e8cd822e7f6cee4ced21962bbc76ca7561785/eox_tenant-13.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "afcada3cf7ee9c326979c01aa142be8e869c5ce1a4dae319c09fe147066cbfbd",
                "md5": "4a9bbb432b93bf3512f7ff3893d94079",
                "sha256": "d158fe3cdb6514e2767185425d21676a9d2d2be17e9202d54828cd5df7cd3cb7"
            },
            "downloads": -1,
            "filename": "eox_tenant-13.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4a9bbb432b93bf3512f7ff3893d94079",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 73045,
            "upload_time": "2025-01-27T13:21:38",
            "upload_time_iso_8601": "2025-01-27T13:21:38.234562Z",
            "url": "https://files.pythonhosted.org/packages/af/ca/da3cf7ee9c326979c01aa142be8e869c5ce1a4dae319c09fe147066cbfbd/eox_tenant-13.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-27 13:21:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "eox-tenant"
}
        
Elapsed time: 0.37440s