Install & Compatibility
Where this runs
tested against v0.17.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.3s · import 0.000s · 23MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
LoginView
✓ from authlib.views import LoginView
✗ from authlib.views import LoginView
Minimal setup with login/logout views using environment variables for OAuth2 credentials.
import os
from django.conf import settings
from django.urls import path
from authlib.views import LoginView, LogoutView
# Ensure required settings
if not settings.configured:
settings.configure(
DEBUG=True,
SECRET_KEY='test-secret',
ROOT_URLCONF=__name__,
AUTH_USER_MODEL='auth.User',
AUTH_TOKEN_URL=os.environ.get('AUTH_TOKEN_URL', 'https://provider/token'),
AUTH_CLIENT_ID=os.environ.get('AUTH_CLIENT_ID', 'client-id'),
AUTH_CLIENT_SECRET=os.environ.get('AUTH_CLIENT_SECRET', 'secret'),
)
urlpatterns = [
path('login/', LoginView.as_view(), name='login'),
path('logout/', LogoutView.as_view(), name='logout'),
]
if __name__ == '__main__':
from django.core.management import execute_from_command_line
execute_from_command_line(['manage.py', 'runserver'])
Upgrade
Version history
0.17.2latest on PyPI · released Nov 18, 2024
Audit
Dependencies
djangorequiredCore dependency for Django framework
requestsoptionalUsed for OAuth2 and other HTTP requests