Skip to main content

A framework for collating Globus Search data for use with various Globus services.

Project description

Django Globus Portal Framework

Globus Portal Framework is a collection of tools for quickly bootstrapping a portal for Globus Search. Use the guide below to get your portal running with Globus Auth and your custom search data. After that, you can make your data more accessible with Globus Transfer, or extend it how you want with your custom workflow.

Requirements

  • Python 3.5 or higher
  • Django 2.2, 3.0

Quick-Start Guide

Let's get started with a simple Globus Search portal.

    $ pip install django-admin
    $ pip install -e git+https://github.com/globusonline/django-globus-portal-framework#egg=django-globus-portal-framework
    $ django-admin startproject myproject
    $ cd myproject

You'll need a Client ID from Globus. Follow these instructions from the Globus Auth Developer Guide.

For your portal, ensure your Globus App has these settings:

In your myproject/settings.py file, add the following settings to your project's settings.py file. Existing Django settings are hidden by ....

SOCIAL_AUTH_GLOBUS_KEY = 'Put your Client ID here'
SOCIAL_AUTH_GLOBUS_SECRET = 'Put your Client Secret Here'


SEARCH_INDEXES = {
    # Leave this blank to show the built-in test index
    # 'your-index-here': {}
}

INSTALLED_APPS = [
    ...
    'globus_portal_framework',
    'social_django',
]

MIDDLEWARE = [
    ...
    'globus_portal_framework.middleware.ExpiredTokenMiddleware',
    'globus_portal_framework.middleware.GlobusAuthExceptionMiddleware',
    'social_django.middleware.SocialAuthExceptionMiddleware',
]

SOCIAL_AUTH_GLOBUS_SCOPE = [
    'urn:globus:auth:scope:search.api.globus.org:search',
]

AUTHENTICATION_BACKENDS = [
    # A more feature rich version of Python Social Auth for Django.
    'globus_portal_framework.auth.GlobusOpenIdConnect',
    'django.contrib.auth.backends.ModelBackend',
]

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(BASE_DIR, 'myproject', 'templates'),
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                ...
                'globus_portal_framework.context_processors.globals',
                'social_django.context_processors.backends',
                'social_django.context_processors.login_redirect',
            ],
        },
    },
]

Now, add your URLs in your myproject/urls.py file. These will provide /login and /logout URLs in addition to index urls at /myindex/. Index URLs are created automatically by the keys in your SEARCH_INDEXES variable in your settings.py file.

from django.urls import path, include

urlpatterns = [
    # Provides the basic search portal
    path('', include('globus_portal_framework.urls')),
    # (OPTIONAL) Provides debugging for your Globus Search Index result data
    path('', include('globus_portal_framework.urls_debugging')),
    # (RECOMMENDED) Provides Login urls for Globus Auth
    path('', include('social_django.urls', namespace='social')),
]

Do your initial database migration and run your local server. The manage.py script was created by django-admin startproject and should be in the top level of your project directory.

    $ python manage.py migrate
    $ python manage.py runserver

Customizing Your Portal

This gives you a basic portal with Globus Auth and Globus Search. From here, you will likely want to request a search index to setup your custom portal. Send an email to support@globus.org with a brief description of what you want. Once you have a search index, See the resources below for customizing it to your needs:

See a minimal complete project here for reference (Requires Permission): DGPF Example App

Extended Features

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-globus-portal-framework-0.3.24.tar.gz (965.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django-globus-portal-framework-0.3.24.tar.gz.

File metadata

  • Download URL: django-globus-portal-framework-0.3.24.tar.gz
  • Upload date:
  • Size: 965.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for django-globus-portal-framework-0.3.24.tar.gz
Algorithm Hash digest
SHA256 e43d00f40c482b0d8dc123c544f56ffa40c05d32d70e16081dad232d92d8c2c6
MD5 0c88d15b0ab041c4d593e43668e15ba2
BLAKE2b-256 386edc533fd02b162fb8c7bf9779e2865723338ec6067564ab036efc78c378cf

See more details on using hashes here.

File details

Details for the file django_globus_portal_framework-0.3.24-py3-none-any.whl.

File metadata

  • Download URL: django_globus_portal_framework-0.3.24-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

File hashes

Hashes for django_globus_portal_framework-0.3.24-py3-none-any.whl
Algorithm Hash digest
SHA256 594c616dcb5ee9ed340ef269d1f91aae0b848c0b66364035c2193bd28f101a76
MD5 ade69996cca32226df2fc699b9514b96
BLAKE2b-256 8ac207a7b1ac03278a1ef26cae3b4822864430d84c5727c509ab388b5710f02e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page