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.9.dev0.tar.gz (959.4 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.9.dev0.tar.gz.

File metadata

  • Download URL: django-globus-portal-framework-0.3.9.dev0.tar.gz
  • Upload date:
  • Size: 959.4 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.9.dev0.tar.gz
Algorithm Hash digest
SHA256 0a559648a63774d0baa16ae4c0b789982af1f3bbb78f37bfe0e37d34fac84af1
MD5 eccb5051f54dc045b22050601ee58464
BLAKE2b-256 620f3ad69f3a2f2e6c12f5fca5a67bb96dbc2c615f1d8f1da22be5a0a7823646

See more details on using hashes here.

File details

Details for the file django_globus_portal_framework-0.3.9.dev0-py3-none-any.whl.

File metadata

  • Download URL: django_globus_portal_framework-0.3.9.dev0-py3-none-any.whl
  • Upload date:
  • Size: 999.0 kB
  • 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.9.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 85b4d77bdd0ca5347045bff3e91e032e34a7ec77a79e2eaa6804219ade5f2bd5
MD5 d983c5d4160dc37045cb5a1fb8c4b742
BLAKE2b-256 867b11691ef002cc3294180413f62cd742a74e22263caf47c2a67e257b87876d

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