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:
- Redirect URL--http://localhost:8000/complete/globus/
- Native App--Unchecked
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:
- Configuring Your Index -- Configure the basics for your index
- Configuring Facets -- Configure facets for filtering search results
- Customzing Fields and Templates -- Show users your custom search data
- Adding Transfer and Preview -- Enrich your search results
See a minimal complete project here for reference (Requires Permission): DGPF Example App
Extended Features
- DGPF Confidential Client (Requires Permission) -- Secure your raw search record data from user access
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-globus-portal-framework-0.3.22.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f38e9a185acad032caef47969e166b253dc7e23f98c4c644bb6f7e65299decf |
|
MD5 | e72438b12ebb161f699d94552b887ba1 |
|
BLAKE2b-256 | 5b5b0c1f00405cd198cd90b918cfaf93c7e9dfbd2a61ca96508694aeb3270747 |
Hashes for django_globus_portal_framework-0.3.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e4bf777c24026f996dd8fe83ef60732f85635035bb71941992340a2c06595dd |
|
MD5 | 35f8dd33e9d19915810eda40ed736651 |
|
BLAKE2b-256 | edd2049afbe3aee52ecc0de6189b1f2683223de8f771f6614b1b631aba5a1c88 |