Skip to content

Instantly share code, notes, and snippets.

View lgoodridge's full-sized avatar

Lance Goodridge lgoodridge

  • Google
  • New York, NY
View GitHub Profile
from django.shortcuts import render
from uniauth.decorators import login_required
@login_required
def index(request):
return render(request, 'demo-app/index.html')
urlpatterns = [
...
url('accounts/', include('uniauth.urls.cas_only', namespace='uniauth')),
]
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'uniauth.backends.CASBackend',
]
LOGIN_URL = "/accounts/login/"
UNIAUTH_LOGIN_DISPLAY_STANDARD = False
UNIAUTH_LOGOUT_CAS_COMPLETELY = True
INSTALLED_APPS = [
...
uniauth,
]