Skip to content

Instantly share code, notes, and snippets.

@alee
alee / views.py
Last active March 24, 2024 19:00
example Django view function that can be used for Discourse SSO, i.e., Discourse delegates User authentication to Django
import base64
import hmac
import hashlib
from urllib import parse
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseBadRequest, HttpResponseRedirect
from django.conf import settings
@login_required