You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2023/09/27 18:59:22 UTC

[airavata-cookiecutter-django-app] branch main created (now 6339f70)

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git


      at 6339f70  AIRAVATA-3649 Adding documentation link

This branch includes the following new commits:

     new 3f30491  initial commit
     new 16a98a8  Updating README with usage instructions
     new f6a9d22  Adding output_views directory
     new 061cfff  AppConfig class name to end in "Config"
     new 50ab1e0  user_storage module example code and links to docs
     new 5a38df0  Adding Airavata API client example call
     new 8a72803  Adding JavaScript SDK sample code
     new e9ce781  Fixing output_views module
     new 947efa7  Add missing 'load static'
     new e1c4ce9  Add README for static folder
     new 4e8f608  Add documentation on how to configure settings in AppConfig class
     new aedc492  Updating "gateways tutorial" -> "custom ui tutorial"
     new 215d573  version upgrade
     new 6de79ba  Handle hyphens in project name when creating class name
     new 3d256c5  Adding queue_settings_calculators.py boilerplate
     new 6339f70  AIRAVATA-3649 Adding documentation link

The 16 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[airavata-cookiecutter-django-app] 07/16: Adding JavaScript SDK sample code

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 8a72803381850bcabc62f40152fc3bd2db5409a5
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jun 3 11:32:56 2021 -0400

    Adding JavaScript SDK sample code
---
 .../{{cookiecutter.project_slug}}/home.html        | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
index 523a4e0..0913ce1 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
@@ -9,3 +9,31 @@
     </main>
 </div>
 {% endblock content %}
+
+{% block scripts %}
+<!-- Load the AiravataAPI JavaScript SDK (optional) -->
+<script src="{% static 'django_airavata_api/dist/airavata-api.js' %}"></script>
+<script>
+    const { models, services, session, utils } = AiravataAPI;
+
+    // Your code here ...
+    // Example code: AiravataAPI JavaScript SDK
+    // Use the JavaScript SDK to make REST API calls. For example, load the most
+    // recent 5 experiments created by the current user:
+    //
+    // services.ExperimentSearchService
+    //         .list({limit: 5,
+    //             [models.ExperimentSearchFields.USER_NAME.name]: session.Session.username,
+    //         })
+    //         .then(data => {
+    //             const experiments = data.results;
+    //             // Do something with the experiments ...
+    //         });
+    //
+    // See the Gateways tutorial for more examples:
+    // https://apache-airavata-django-portal.readthedocs.io/en/latest/tutorial/gateways_tutorial/#tutorial-exercise-create-a-custom-django-app
+    // To see what is in the `AiravataAPI` JavaScript library, take a look at
+    // it's index.js file:
+    // https://github.com/apache/airavata-django-portal/blob/master/django_airavata/apps/api/static/django_airavata_api/js/index.js
+</script>
+{% endblock scripts %}


[airavata-cookiecutter-django-app] 04/16: AppConfig class name to end in "Config"

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 061cfff4c22f538abdfb67b0173dfef822859c8a
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri May 28 15:26:06 2021 -0400

    AppConfig class name to end in "Config"
---
 cookiecutter.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cookiecutter.json b/cookiecutter.json
index b162761..d0f23d8 100644
--- a/cookiecutter.json
+++ b/cookiecutter.json
@@ -2,7 +2,7 @@
   "project_name": "My Custom Django App",
   "project_slug": "{{ cookiecutter.project_name | slugify(separator='_')}}",
   "project_short_description": "Custom Django app with everything needed to be installed in the airavata-django-portal",
-  "app_config_class_name": "{{ cookiecutter.project_name | title | replace(' ', '') }}",
+  "app_config_class_name": "{{ cookiecutter.project_name | title | replace(' ', '') }}Config",
   "version": "0.1.0",
   "_copy_without_render": [
       "*.html"


[airavata-cookiecutter-django-app] 15/16: Adding queue_settings_calculators.py boilerplate

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 3d256c54e18c822b7cb0d76dc4adb2ce0a45e1e4
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Aug 29 14:42:00 2022 -0400

    Adding queue_settings_calculators.py boilerplate
---
 .../{{cookiecutter.project_slug}}/apps.py          |  5 +++++
 .../queue_settings_calculators.py                  | 23 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
index b8af0d7..3d8838f 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
@@ -24,3 +24,8 @@ class {{ cookiecutter.app_config_class_name }}(AppConfig):
     # description of *nav* in
     # https://apache-airavata-django-portal.readthedocs.io/en/latest/dev/new_django_app/#appconfig-settings
     # for more details for more details.
+
+    def ready(self) -> None:
+        # Uncomment to register your queue settings calculators. See TODO
+        # from {{ cookiecutter.project_slug }} import queue_settings_calculators  # noqa
+        pass
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/queue_settings_calculators.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/queue_settings_calculators.py
new file mode 100644
index 0000000..df7ba89
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/queue_settings_calculators.py
@@ -0,0 +1,23 @@
+from airavata.model.experiment.ttypes import ExperimentModel
+from airavata_django_portal_sdk.decorators import queue_settings_calculator
+
+# See TODO for more information
+@queue_settings_calculator(
+    id="{{ cookiecutter.project_slug}}-my-queue-settings-calculator", name="{{ cookiecutter.project_name}}: My Queue Settings Calculator"
+)
+def my_queue_settings_calculator(request, experiment_model: ExperimentModel):
+    # See https://airavata.apache.org/api-docs/master/experiment_model.html#Struct_ExperimentModel for ExperimentModel fields
+
+    # TODO: Implement logic here to determine appropriate queue settings for experiment_model
+    total_core_count = 4
+    queue_name = "shared"
+    node_count = 1
+    walltime_limit = 30
+
+    # Return a dictionary with the queue settings values
+    result = {}
+    result["totalCPUCount"] = total_core_count
+    result["queueName"] = queue_name
+    result["nodeCount"] = node_count
+    result["wallTimeLimit"] = walltime_limit
+    return result


[airavata-cookiecutter-django-app] 13/16: version upgrade

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 215d5732a1607031e816d181d899408d3a129ede
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Sep 24 17:02:44 2021 -0400

    version upgrade
---
 {{cookiecutter.project_slug}}/setup.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg
index 41252a4..70ecdae 100644
--- a/{{cookiecutter.project_slug}}/setup.cfg
+++ b/{{cookiecutter.project_slug}}/setup.cfg
@@ -8,7 +8,7 @@ packages = find:
 # Include data files as specified in MANIFEST.in
 include_package_data = True
 install_requires =
-    django >= 2.2
+    django >= 3.2
     airavata-django-portal-sdk
 
 [options.entry_points]


[airavata-cookiecutter-django-app] 08/16: Fixing output_views module

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit e9ce781b77a544ac095e7cbc7fa0eef7ac1e4147
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Jun 4 12:28:50 2021 -0400

    Fixing output_views module
---
 .../{output_views.py => output_views}/__init__.py                         | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/output_views.py/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/output_views/__init__.py
similarity index 100%
rename from {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/output_views.py/__init__.py
rename to {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/output_views/__init__.py


[airavata-cookiecutter-django-app] 12/16: Updating "gateways tutorial" -> "custom ui tutorial"

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit aedc492e36b7b2dc0e2fc9d59bb7242c2ebca74d
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jul 7 14:52:00 2021 -0400

    Updating "gateways tutorial" -> "custom ui tutorial"
---
 .../templates/{{cookiecutter.project_slug}}/home.html                 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
index 5c705b2..5e184a2 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
@@ -32,8 +32,8 @@
     //             // Do something with the experiments ...
     //         });
     //
-    // See the Gateways tutorial for more examples:
-    // https://apache-airavata-django-portal.readthedocs.io/en/latest/tutorial/gateways_tutorial/#tutorial-exercise-create-a-custom-django-app
+    // See the Custom UI tutorial for more examples:
+    // https://apache-airavata-django-portal.readthedocs.io/en/latest/tutorial/custom_ui_tutorial/#tutorial-exercise-create-a-custom-django-app
     // To see what is in the `AiravataAPI` JavaScript library, take a look at
     // it's index.js file:
     // https://github.com/apache/airavata-django-portal/blob/master/django_airavata/apps/api/static/django_airavata_api/js/index.js


[airavata-cookiecutter-django-app] 02/16: Updating README with usage instructions

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 16a98a855e7d1a9e5af1f1ac67d2fa939f95989b
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu May 27 11:56:36 2021 -0400

    Updating README with usage instructions
---
 README.md | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/README.md b/README.md
index e69de29..e484125 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,15 @@
+# Custom Airavata Django App Cookiecutter
+
+## Quickstart
+
+Install the latest Cookiecutter if you haven't installed it yet:
+
+    pip install --user -U cookiecutter
+
+Generate a custom Django app that works with the
+[Airavata Django Portal](https://github.com/apache/airavata-django-portal)
+
+    cookiecutter https://github.com/machristie/cookiecutter-airavata-django-app.git
+
+Then see the README.md in the generated project folder for instructions on how
+to install your custom Django app into an Airavata Django Portal instance.


[airavata-cookiecutter-django-app] 11/16: Add documentation on how to configure settings in AppConfig class

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 4e8f6084380345790aef286aea24eed1206b2592
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jul 7 14:50:45 2021 -0400

    Add documentation on how to configure settings in AppConfig class
---
 .../{{cookiecutter.project_slug}}/apps.py             | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
index 0055edc..b8af0d7 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
@@ -2,6 +2,25 @@ from django.apps import AppConfig
 
 
 class {{ cookiecutter.app_config_class_name }}(AppConfig):
+    # Standard Django app configuration. For more information on these settings,
+    # see https://docs.djangoproject.com/en/2.2/ref/applications/#application-configuration
     name = '{{ cookiecutter.project_slug }}'
     label = name
     verbose_name = "{{ cookiecutter.project_name }}"
+
+    # The following are Airavata Django Portal specific custom Django app settings
+
+    # Set url_home to a namespaced URL that will be the homepage when the custom
+    # app is selected from the main menu
+    url_home = "{{ cookiecutter.project_slug }}:home"
+
+    # Set fa_icon_class to a FontAwesome CSS class for an icon to associate with
+    # the custom app. Find an icon class at https://fontawesome.com/icons?d=gallery&p=2&s=regular,solid&m=free
+    fa_icon_class = "fa-circle"
+
+    # Second level navigation. Defines sub-navigation that displays on the left
+    # hand side navigation bar in the Django Portal. This is optional but
+    # recommended if your custom Django app has multiple entry points. See the
+    # description of *nav* in
+    # https://apache-airavata-django-portal.readthedocs.io/en/latest/dev/new_django_app/#appconfig-settings
+    # for more details for more details.


[airavata-cookiecutter-django-app] 05/16: user_storage module example code and links to docs

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 50ab1e0d872d93b431aef7488a0d8117f7385129
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri May 28 15:26:27 2021 -0400

    user_storage module example code and links to docs
---
 .../{{cookiecutter.project_slug}}/views.py                       | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
index 45028b8..6e47202 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
@@ -2,10 +2,19 @@ from django.contrib.auth.decorators import login_required
 from django.http import HttpResponse, HttpResponseNotFound
 from django.shortcuts import render
 
+from airavata_django_portal_sdk import user_storage
+
 # Create your views here.
 
 @login_required
 def home(request):
+
+    # In your Django views, you can make calls to the user_storage module to manage a user's files in the gateway
+    # user_storage.listdir(request, "")  # lists the user's home directory
+    # user_storage.open_file(request, data_product_uri=...)  # open's a file for a given data_product_uri
+    # user_storage.save(request, "path/in/user/storage", file)  # save a file to a path in the user's storage
+    # For more information as well as other user_storage functions, see https://airavata-django-portal-sdk.readthedocs.io/en/latest/
+
     return render(request, "{{ cookiecutter.project_slug }}/home.html", {
         'project_name': "{{ cookiecutter.project_name }}"
     })


[airavata-cookiecutter-django-app] 06/16: Adding Airavata API client example call

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 5a38df026aee619f6c9d84ca601091df911a0f03
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 2 13:27:13 2021 -0400

    Adding Airavata API client example call
---
 {{cookiecutter.project_slug}}/setup.cfg             |  1 +
 .../{{cookiecutter.project_slug}}/views.py          | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg
index cbe2c59..41252a4 100644
--- a/{{cookiecutter.project_slug}}/setup.cfg
+++ b/{{cookiecutter.project_slug}}/setup.cfg
@@ -9,6 +9,7 @@ packages = find:
 include_package_data = True
 install_requires =
     django >= 2.2
+    airavata-django-portal-sdk
 
 [options.entry_points]
 airavata.djangoapp =
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
index 6e47202..764354e 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
@@ -1,3 +1,4 @@
+from django.conf import settings
 from django.contrib.auth.decorators import login_required
 from django.http import HttpResponse, HttpResponseNotFound
 from django.shortcuts import render
@@ -9,10 +10,30 @@ from airavata_django_portal_sdk import user_storage
 @login_required
 def home(request):
 
+    # Example code: Airavata API client
+    # Make calls to the Airavata API from your view, for example:
+    #
+    # experiments = request.airavata_client.searchExperiments(
+    #        request.authz_token, settings.GATEWAY_ID, request.user.username, filters={},
+    #        limit=20, offset=0)
+    #
+    # The authorization token is always the first argument of Airavata API calls
+    # and is available as 'request.authz_token'. Some API methods require a
+    # 'gatewayID' argument and that is available on the Django settings object
+    # as 'settings.GATEWAY_ID'.
+    # For documentation on other Airavata API methods, see
+    # https://docs.airavata.org/en/master/technical-documentation/airavata-api/.
+    # The Airavata Django Portal uses the Airavata Python Client SDK:
+    # https://github.com/apache/airavata/tree/master/airavata-api/airavata-client-sdks/airavata-python-sdk
+
+
+    # Example code: user_storage module
     # In your Django views, you can make calls to the user_storage module to manage a user's files in the gateway
+    #
     # user_storage.listdir(request, "")  # lists the user's home directory
     # user_storage.open_file(request, data_product_uri=...)  # open's a file for a given data_product_uri
     # user_storage.save(request, "path/in/user/storage", file)  # save a file to a path in the user's storage
+    #
     # For more information as well as other user_storage functions, see https://airavata-django-portal-sdk.readthedocs.io/en/latest/
 
     return render(request, "{{ cookiecutter.project_slug }}/home.html", {


[airavata-cookiecutter-django-app] 16/16: AIRAVATA-3649 Adding documentation link

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 6339f7047f954af9cc269f8771c031695291e411
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Oct 7 13:37:10 2022 -0400

    AIRAVATA-3649 Adding documentation link
---
 {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py     | 2 +-
 .../{{cookiecutter.project_slug}}/queue_settings_calculators.py         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
index 3d8838f..b667001 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
@@ -26,6 +26,6 @@ class {{ cookiecutter.app_config_class_name }}(AppConfig):
     # for more details for more details.
 
     def ready(self) -> None:
-        # Uncomment to register your queue settings calculators. See TODO
+        # Uncomment to register your queue settings calculators.
         # from {{ cookiecutter.project_slug }} import queue_settings_calculators  # noqa
         pass
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/queue_settings_calculators.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/queue_settings_calculators.py
index df7ba89..8f70e10 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/queue_settings_calculators.py
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/queue_settings_calculators.py
@@ -1,7 +1,7 @@
 from airavata.model.experiment.ttypes import ExperimentModel
 from airavata_django_portal_sdk.decorators import queue_settings_calculator
 
-# See TODO for more information
+# See https://apache-airavata-django-portal.readthedocs.io/en/latest/dev/queue_settings_calculator/ for more information
 @queue_settings_calculator(
     id="{{ cookiecutter.project_slug}}-my-queue-settings-calculator", name="{{ cookiecutter.project_name}}: My Queue Settings Calculator"
 )


[airavata-cookiecutter-django-app] 03/16: Adding output_views directory

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit f6a9d22a5108ee15eca18a53885d6a53d561ab38
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri May 28 15:25:47 2021 -0400

    Adding output_views directory
---
 .../{{cookiecutter.project_slug}}/output_views.py/__init__.py             | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/output_views.py/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/output_views.py/__init__.py
new file mode 100644
index 0000000..e69de29


[airavata-cookiecutter-django-app] 01/16: initial commit

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 3f30491240dcc71f22db336473e584e75cc02cb2
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu May 27 11:51:28 2021 -0400

    initial commit
---
 README.md                                                 |  0
 cookiecutter.json                                         | 10 ++++++++++
 {{cookiecutter.project_slug}}/.gitignore                  |  7 +++++++
 {{cookiecutter.project_slug}}/MANIFEST.in                 |  2 ++
 {{cookiecutter.project_slug}}/README.md                   | 15 +++++++++++++++
 {{cookiecutter.project_slug}}/pyproject.toml              |  6 ++++++
 {{cookiecutter.project_slug}}/setup.cfg                   | 15 +++++++++++++++
 {{cookiecutter.project_slug}}/setup.py                    |  3 +++
 .../{{cookiecutter.project_slug}}/__init__.py             |  0
 .../{{cookiecutter.project_slug}}/admin.py                |  3 +++
 .../{{cookiecutter.project_slug}}/apps.py                 |  7 +++++++
 .../{{cookiecutter.project_slug}}/models.py               |  3 +++
 .../templates/{{cookiecutter.project_slug}}/home.html     | 11 +++++++++++
 .../{{cookiecutter.project_slug}}/tests.py                |  3 +++
 .../{{cookiecutter.project_slug}}/urls.py                 |  9 +++++++++
 .../{{cookiecutter.project_slug}}/views.py                | 11 +++++++++++
 16 files changed, 105 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e69de29
diff --git a/cookiecutter.json b/cookiecutter.json
new file mode 100644
index 0000000..b162761
--- /dev/null
+++ b/cookiecutter.json
@@ -0,0 +1,10 @@
+{
+  "project_name": "My Custom Django App",
+  "project_slug": "{{ cookiecutter.project_name | slugify(separator='_')}}",
+  "project_short_description": "Custom Django app with everything needed to be installed in the airavata-django-portal",
+  "app_config_class_name": "{{ cookiecutter.project_name | title | replace(' ', '') }}",
+  "version": "0.1.0",
+  "_copy_without_render": [
+      "*.html"
+  ]
+}
diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore
new file mode 100644
index 0000000..4f6cd5f
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/.gitignore
@@ -0,0 +1,7 @@
+venv
+*.egg-info
+*.pyc
+.vscode
+build
+dist
+*.egg
diff --git a/{{cookiecutter.project_slug}}/MANIFEST.in b/{{cookiecutter.project_slug}}/MANIFEST.in
new file mode 100644
index 0000000..d402524
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/MANIFEST.in
@@ -0,0 +1,2 @@
+recursive-include {{ cookiecutter.project_slug }}/static *
+recursive-include {{ cookiecutter.project_slug }}/templates *
diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md
new file mode 100644
index 0000000..d82e62a
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/README.md
@@ -0,0 +1,15 @@
+# {{ cookiecutter.project_name }}
+
+## Getting Started
+
+1. Follow the instructions for installing the
+   [Airavata Django Portal](https://github.com/apache/airavata-django-portal)
+2. With the Airavata Django Portal virtual environment activated, clone this
+   repo and install it into the portal's virtual environment
+
+   ```
+   cd {{ cookiecutter.project_slug }}
+   pip install -e .
+   ```
+
+3. Start (or restart) the Django Portal server.
diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml
new file mode 100644
index 0000000..374b58c
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/pyproject.toml
@@ -0,0 +1,6 @@
+[build-system]
+requires = [
+    "setuptools>=42",
+    "wheel"
+]
+build-backend = "setuptools.build_meta"
diff --git a/{{cookiecutter.project_slug}}/setup.cfg b/{{cookiecutter.project_slug}}/setup.cfg
new file mode 100644
index 0000000..cbe2c59
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/setup.cfg
@@ -0,0 +1,15 @@
+[metadata]
+name = {{ cookiecutter.project_slug }}
+version = {{ cookiecutter.version }}
+description = {{ cookiecutter.project_short_description }}
+
+[options]
+packages = find:
+# Include data files as specified in MANIFEST.in
+include_package_data = True
+install_requires =
+    django >= 2.2
+
+[options.entry_points]
+airavata.djangoapp =
+    {{ cookiecutter.project_slug }} = {{ cookiecutter.project_slug }}.apps:{{ cookiecutter.app_config_class_name }}
diff --git a/{{cookiecutter.project_slug}}/setup.py b/{{cookiecutter.project_slug}}/setup.py
new file mode 100644
index 0000000..b908cbe
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/setup.py
@@ -0,0 +1,3 @@
+import setuptools
+
+setuptools.setup()
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/admin.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/admin.py
new file mode 100644
index 0000000..8c38f3f
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
new file mode 100644
index 0000000..0055edc
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/apps.py
@@ -0,0 +1,7 @@
+from django.apps import AppConfig
+
+
+class {{ cookiecutter.app_config_class_name }}(AppConfig):
+    name = '{{ cookiecutter.project_slug }}'
+    label = name
+    verbose_name = "{{ cookiecutter.project_name }}"
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/models.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/models.py
new file mode 100644
index 0000000..71a8362
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/models.py
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
new file mode 100644
index 0000000..523a4e0
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
@@ -0,0 +1,11 @@
+{% extends 'base.html' %}
+
+{% block content %}
+<div class="main-content-wrapper">
+    <main class="main-content">
+        <div class="container-fluid">
+            <h1>Welcome to {{ project_name }}</h1>
+        </div>
+    </main>
+</div>
+{% endblock content %}
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/tests.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/tests.py
new file mode 100644
index 0000000..7ce503c
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/urls.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/urls.py
new file mode 100644
index 0000000..8bc72c8
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/urls.py
@@ -0,0 +1,9 @@
+
+from django.urls import path
+
+from . import views
+
+app_name = '{{ cookiecutter.project_slug }}'
+urlpatterns = [
+    path('home/', views.home, name='home'),
+]
diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
new file mode 100644
index 0000000..45028b8
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/views.py
@@ -0,0 +1,11 @@
+from django.contrib.auth.decorators import login_required
+from django.http import HttpResponse, HttpResponseNotFound
+from django.shortcuts import render
+
+# Create your views here.
+
+@login_required
+def home(request):
+    return render(request, "{{ cookiecutter.project_slug }}/home.html", {
+        'project_name': "{{ cookiecutter.project_name }}"
+    })


[airavata-cookiecutter-django-app] 10/16: Add README for static folder

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit e1c4ce975901c272ca5d95dbc604b5881338bfa1
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jun 9 10:25:47 2021 -0400

    Add README for static folder
---
 .../static/{{cookiecutter.project_slug}}/README.md       | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/{{cookiecutter.project_slug}}/README.md
new file mode 100644
index 0000000..375e970
--- /dev/null
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/static/{{cookiecutter.project_slug}}/README.md
@@ -0,0 +1,16 @@
+# Static files folder
+
+Place your static files (JavaScript, CSS, images, etc.) in this folder. Then
+load them in your templates using the static template tag.
+
+```html
+{% raw %}
+{% load static %}
+{% endraw %}
+
+<script src="{{ '{%' }} static '{{ cookiecutter.project_slug }}/some_script.js' %}"></script>
+```
+
+See
+[Part 6 of the Django tutorial](https://docs.djangoproject.com/en/2.2/intro/tutorial06/)
+for more information.


[airavata-cookiecutter-django-app] 14/16: Handle hyphens in project name when creating class name

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 6de79babe9739a9217208baae03011ab42a602f6
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Jan 13 16:52:02 2022 -0500

    Handle hyphens in project name when creating class name
    
    Fixes #1
---
 cookiecutter.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cookiecutter.json b/cookiecutter.json
index d0f23d8..109b4cf 100644
--- a/cookiecutter.json
+++ b/cookiecutter.json
@@ -2,7 +2,7 @@
   "project_name": "My Custom Django App",
   "project_slug": "{{ cookiecutter.project_name | slugify(separator='_')}}",
   "project_short_description": "Custom Django app with everything needed to be installed in the airavata-django-portal",
-  "app_config_class_name": "{{ cookiecutter.project_name | title | replace(' ', '') }}Config",
+  "app_config_class_name": "{{ cookiecutter.project_name | slugify(separator=' ') | title | replace(' ', '') }}Config",
   "version": "0.1.0",
   "_copy_without_render": [
       "*.html"


[airavata-cookiecutter-django-app] 09/16: Add missing 'load static'

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git

commit 947efa76661cda2c88d00f390af882feebc6f5af
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Jun 4 14:01:28 2021 -0400

    Add missing 'load static'
---
 .../templates/{{cookiecutter.project_slug}}/home.html                   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
index 0913ce1..5c705b2 100644
--- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
+++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html
@@ -1,5 +1,7 @@
 {% extends 'base.html' %}
 
+{% load static %}
+
 {% block content %}
 <div class="main-content-wrapper">
     <main class="main-content">