airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Christie (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AIRAVATA-2934) Dynamically load Django apps into the Django portal
Date Mon, 24 Jun 2019 21:06:00 GMT

     [ https://issues.apache.org/jira/browse/AIRAVATA-2934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Marcus Christie updated AIRAVATA-2934:
--------------------------------------
    Description: 
Develop a mechanism for automatically including Django apps that are installed in the Django
portal's virtual environment.

The mechanism that seems most promising is to make use of entry points which I [wrote about
in this blog post|https://marcus.4christies.com/2018/10/dynamically-including-django-apps-using-entry-points/].
The entry point could register the AppConfig object of the Django app.

This would allow the Django portal to:
* loop over these Django apps and add them to INSTALLED_APPS in settings.py
* add these apps to the urls.py url mappings

In addition there is some metadata what would be useful for the AppConfig to provide:
* {{url_home}} - the home url of the app so that it can be linked to. In builtin Django apps
in the Airavata portal, this is used to build the links to the various apps.
* {{app_order}} - the order of the app in dynamically built list of apps
* {{fa_icon_class}} - FontAwesome icon class to use for the app
* {{app_description}} - Longer description of the app

This metadata would be in addition to [{{name}}, {{label}} and {{verbose_name}}, which are
built in properties of AppConfig|https://docs.djangoproject.com/en/2.1/ref/applications/#application-configuration].

Probably for a future issue, but here are some additional concerns:
* Django apps that integrate with the portal should use templates that extend [base.html|https://github.com/apache/airavata-django-portal/blob/master/django_airavata/templates/base.html]
* How to handle building JS code if the Django app requires a build step?  Perhaps could be
part of running {{python setup.py install}}?
* Have the AppConfig provide metadata for populating the left hand side navigation in the
Django portal

h2. TODO
- [x] Have test django app extend base.html
- [x] Implement placeholder left hand side navigation. Create a separate issue for metadata
for populating the left hand side navigation.
- [ ] Documentation
-- how to create a new Airavata app, third party custom app
--- AppConfig metadata: nav, etc.
- [x] when no nav is defined, construct a default one based on the home
- [ ] restrict access to certain views based on whether admins



  was:
Develop a mechanism for automatically including Django apps that are installed in the Django
portal's virtual environment.

The mechanism that seems most promising is to make use of entry points which I [wrote about
in this blog post|https://marcus.4christies.com/2018/10/dynamically-including-django-apps-using-entry-points/].
The entry point could register the AppConfig object of the Django app.

This would allow the Django portal to:
* loop over these Django apps and add them to INSTALLED_APPS in settings.py
* add these apps to the urls.py url mappings

In addition there is some metadata what would be useful for the AppConfig to provide:
* {{url_home}} - the home url of the app so that it can be linked to. In builtin Django apps
in the Airavata portal, this is used to build the links to the various apps.
* {{app_order}} - the order of the app in dynamically built list of apps
* {{fa_icon_class}} - FontAwesome icon class to use for the app
* {{app_description}} - Longer description of the app

This metadata would be in addition to [{{name}}, {{label}} and {{verbose_name}}, which are
built in properties of AppConfig|https://docs.djangoproject.com/en/2.1/ref/applications/#application-configuration].

Probably for a future issue, but here are some additional concerns:
* Django apps that integrate with the portal should use templates that extend [base.html|https://github.com/apache/airavata-django-portal/blob/master/django_airavata/templates/base.html]
* How to handle building JS code if the Django app requires a build step?  Perhaps could be
part of running {{python setup.py install}}?
* Have the AppConfig provide metadata for populating the left hand side navigation in the
Django portal

h2. TODO
- [x] Have test django app extend base.html
- [x] Implement placeholder left hand side navigation. Create a separate issue for metadata
for populating the left hand side navigation.
- [ ] Documentation
-- how to create a new Airavata app, third party custom app
--- AppConfig metadata: nav, etc.
- [x] when no nav is defined, construct a default one based on the home



> Dynamically load Django apps into the Django portal
> ---------------------------------------------------
>
>                 Key: AIRAVATA-2934
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-2934
>             Project: Airavata
>          Issue Type: New Feature
>          Components: Django Portal
>            Reporter: Marcus Christie
>            Assignee: Marcus Christie
>            Priority: Major
>
> Develop a mechanism for automatically including Django apps that are installed in the
Django portal's virtual environment.
> The mechanism that seems most promising is to make use of entry points which I [wrote
about in this blog post|https://marcus.4christies.com/2018/10/dynamically-including-django-apps-using-entry-points/].
The entry point could register the AppConfig object of the Django app.
> This would allow the Django portal to:
> * loop over these Django apps and add them to INSTALLED_APPS in settings.py
> * add these apps to the urls.py url mappings
> In addition there is some metadata what would be useful for the AppConfig to provide:
> * {{url_home}} - the home url of the app so that it can be linked to. In builtin Django
apps in the Airavata portal, this is used to build the links to the various apps.
> * {{app_order}} - the order of the app in dynamically built list of apps
> * {{fa_icon_class}} - FontAwesome icon class to use for the app
> * {{app_description}} - Longer description of the app
> This metadata would be in addition to [{{name}}, {{label}} and {{verbose_name}}, which
are built in properties of AppConfig|https://docs.djangoproject.com/en/2.1/ref/applications/#application-configuration].
> Probably for a future issue, but here are some additional concerns:
> * Django apps that integrate with the portal should use templates that extend [base.html|https://github.com/apache/airavata-django-portal/blob/master/django_airavata/templates/base.html]
> * How to handle building JS code if the Django app requires a build step?  Perhaps could
be part of running {{python setup.py install}}?
> * Have the AppConfig provide metadata for populating the left hand side navigation in
the Django portal
> h2. TODO
> - [x] Have test django app extend base.html
> - [x] Implement placeholder left hand side navigation. Create a separate issue for metadata
for populating the left hand side navigation.
> - [ ] Documentation
> -- how to create a new Airavata app, third party custom app
> --- AppConfig metadata: nav, etc.
> - [x] when no nav is defined, construct a default one based on the home
> - [ ] restrict access to certain views based on whether admins



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message