Installation and Setup

Install the packages below to get started. Globus Portal Framework requires Python 3.7 and higher.

pip install django-admin django-globus-portal-framework

Django-admin will help you bootstrap your initial portal while Globus Portal Framework will add tooling for Globus services, Search, Transfer, and Auth.

Run the django-admin command below to create your project layout.

django-admin startproject myportal
cd myportal

This will create your basic Django project with the following project structure:


Globus Auth

Globus Auth will allow your users to login to the portal, storing their tokens in the database for Search, Transfer, or any other custom functionality you want to implement.

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

When you register your application with Globus, make sure it has the following settings:

  • Redirect URLhttp://localhost:8000/complete/globus/

  • Native AppUnchecked


Next, you will need to modify your myportal/ file to enable user auth and Globus Portal Framework components. You can copy-paste the individual settings below, or use our Settings Example for a complete file reference.

# Your portal credentials for a Globus Auth Flow
SOCIAL_AUTH_GLOBUS_KEY = 'Put your Client ID here'
SOCIAL_AUTH_GLOBUS_SECRET = 'Put your Client Secret Here'

# This is a general Django setting if views need to redirect to login
LOGIN_URL = '/login/globus'

# This dictates which scopes will be requested on each user login

# Installed apps tells Django which packages to load on startup

# Middleware provides exception handling

# Authentication backends setup OAuth2 handling and where user data should be
# stored

# The context processor below provides some basic context to all templates
      'BACKEND': 'django.template.backends.django.DjangoTemplates',
      'DIRS': [],
      'APP_DIRS': True,
      'OPTIONS': {
          'context_processors': [

Add the base URLs for Globus Portal Framework in your myportal/ file. These will provide a starting point for your Globus Portal. You may keep or discard any existing paths in your urlpatterns.

from django.urls import path, include

urlpatterns = [
    # Provides the basic search portal
    path('', include('globus_portal_framework.urls')),
    # Provides Login urls for Globus Auth
    path('', include('social_django.urls', namespace='social')),

Now run your server to see your Globus Portal. Migrate will setup your database, which will be used in the next section when adding Globus Auth. The second command will run your Globus Portal.


Make sure you use http://localhost:8000 in your browser, so your URL matches the callback URL for your Globus App at A mismatch will cause an error when logging in.

python migrate
python runserver localhost:8000

You should now be able to view a portal at http://localhost:8000/