AIRAVATA-3698 Fix renames of EntryPoint properties
1 file changed
tree: b312ca9e26f99b90d570c3b9055de07fbc591fb9
  1. airavata_django_portal_commons/
  2. .gitignore
  4. pyproject.toml
  6. setup.cfg

Airavata Django Portal Commons

Utilities for working with dynamically loaded Django apps.

Getting Started

Install this package with pip

pip install airavata-django-portal-commons

Dynamically loaded Django apps

  1. At the end of your Django server's file add
import sys
from airavata_django_portal_commons import dynamic_apps

# Add any dynamic apps installed in the virtual environment

# (Optional) merge WEBPACK_LOADER settings from custom Django apps
settings_module = sys.modules[__name__]
  • Note: if the dynamic Django app uses WEBPACK_LOADER, keep in mind that it is important that the version of django-webpack-loader and the version of webpack-bundle-tracker be compatible. If you're using django-webpack-loader prior to version 1.0 then a known good pair of versions is django-webpack-loader==0.6.0 and webpack-bundle-tracker==0.4.3.
  1. Also add 'airavata_django_portal_commons.dynamic_apps.context_processors.custom_app_registry' to the context_processors list:
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ...
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
  1. In your file add the following to the urlpatterns
urlpatterns = [
    # ...
    path('', include('airavata_django_portal_commons.dynamic_apps.urls')),

Creating a dynamically loaded Django app

See for the latest information.

Note that by default the cookiecutter template registers Django apps under the entry_point group name of airavata.djangoapp, but you can change this. Just make sure that when you call dynamic_apps.load that you pass as the second argument the name of the entry_point group.


Making a new release

  1. Update the version in setup.cfg.

  2. Commit the update to setup.cfg.

  3. Tag the repo with the same version, with the format v${version_number}. For example, if the version number in setup.cfg is “1.2” then tag the repo with “v1.2”.

    git tag -m $VERSION $VERSION
    git push --follow-tags
  4. In a clean checkout

    cd /tmp/
    git clone /path/to/airavata-django-portal-commons/ -b $VERSION
    cd airavata-django-portal-commons
    python3 -m venv venv
    source venv/bin/activate
    python3 -m pip install --upgrade pip build
    python3 -m build
  5. Push to Optionally can push to See for more info.

    python3 -m pip install --upgrade twine
    python3 -m twine upload dist/*