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
- At the end of your Django server's settings.py file add
import sys
from airavata_django_portal_commons import dynamic_apps
# Add any dynamic apps installed in the virtual environment
dynamic_apps.load(INSTALLED_APPS)
# (Optional) merge WEBPACK_LOADER settings from custom Django apps
settings_module = sys.modules[__name__]
dynamic_apps.merge_settings(settings_module)
- 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.
- Also add
'airavata_django_portal_commons.dynamic_apps.context_processors.custom_app_registry'to the context_processors list:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ...
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
...
'airavata_django_portal_commons.dynamic_apps.context_processors.custom_app_registry',
],
},
},
]
- In your urls.py file add the following to the urlpatterns
urlpatterns = [
# ...
path('', include('airavata_django_portal_commons.dynamic_apps.urls')),
]
Creating a dynamically loaded Django app
See https://apache-airavata-django-portal.readthedocs.io/en/latest/dev/custom_django_app/ 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.
Developing
Making a new release
-
Update the version in setup.cfg.
-
Commit the update to setup.cfg.
-
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".VERSION=... git tag -m $VERSION $VERSION git push --follow-tags -
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 -
Push to pypi.org. Optionally can push to test.pypi.org. See https://packaging.python.org/tutorials/packaging-projects/ for more info.
python3 -m pip install --upgrade twine python3 -m twine upload dist/*
Metadata
Release files for airavata-django-portal-commons 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| airavata-django-portal-commons-1.0.3.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| airavata_django_portal_commons-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / airavata-django-portal-commons-1.0.3.tar.gz
| Download URL | airavata-django-portal-commons-1.0.3.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6da761f9a351b824471dd3c28dbf3d32b6cf3398c579f1f6545f4d814c8b7f7
|
|
BLAKE2b-256 checksum How to use checksums |
a8093a6bd40535b6f52270d98ac5de0ac4e79845669238754ff7453c94f3d515
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.9
|
Release files / airavata_django_portal_commons-1.0.3-py3-none-any.whl
| Download URL | airavata_django_portal_commons-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a601aa7a823482432c9108cac557849e8d21a481c95d940f9f990fca1b5337b6
|
|
BLAKE2b-256 checksum How to use checksums |
276ef9766d1380c91fd000f16faa525096c4ec7d421440439680863fc1b16a96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.9
|
Security for airavata-django-portal-commons 1.0.3
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.