skillfed

django-oauth-toolkit

OAuth2 Provider for Django

django-oauth-toolkit v3.4.0 5.2M downloads/30d#2,136 on PyPI3,333
Permissive license Copyright (c) 2013, Massimiliano Pippi, Federico Frenguelli and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted… (full text in the JSON record) Active released

What it is and what it does

Django OAuth Toolkit is an OAuth2 provider library that integrates into Django projects to add standards-compliant OAuth2 authorization and token management. It builds on oauthlib to handle RFC-compliant specification and provides pre-built endpoints, data models, and business logic so you don't have to implement OAuth2 from scratch. The package is designed for two main scenarios: protecting your Django REST API with OAuth2 authentication, or running a full OAuth2 authorization server to issue tokens for your infrastructure.

The toolkit handles the core OAuth2 flows and token lifecycle through Django models and views. You configure it by adding the app to INSTALLED_APPS and including its URL patterns, then your Django project becomes an OAuth2 provider. It relies on django, requests, urllib3, oauthlib, and jwcrypto to manage HTTP communication, cryptographic operations, and standards compliance.

Use it for:

  • Protect a Django REST API by requiring OAuth2 bearer tokens from client applications.
  • Build an OAuth2 authorization server to issue and manage tokens for multiple services in your infrastructure.
  • Implement delegated authentication so third-party apps can request access to user data without storing passwords.
  • Add token endpoints to a Django application for secure session management.
  • Integrate OAuth2 scopes and permissions into Django's permission system for fine-grained access control.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds OAuth2 authorization server capabilities to Django applications, providing endpoints and logic to protect APIs with OAuth2 authentication and manage token issuance.

Yes. The package is actively maintained, production-stable, has no known vulnerabilities, installs with low friction, and solves a well-defined problem—adding OAuth2 provider capabilities to Django. It is RFC-compliant and widely used (top 5000 PyPI packages). Install it if you need to add OAuth2 authentication or token management to a Django application.

Install

django-oauth-toolkit on PyPI

pip

pip install django-oauth-toolkit

uv

uv add django-oauth-toolkit

poetry

poetry add django-oauth-toolkit

Installing django-oauth-toolkit

Before you install

Low friction installation with a pure-Python wheel. Actively maintained with a release 21 days ago and ongoing repository activity. Depends on well-established packages: django, requests, urllib3, oauthlib, and jwcrypto.

License in practice

BSD license (permissive) allows commercial and private use with minimal restrictions—you must retain copyright notices and disclaimers in distributions.

Quickstart

pip install django-oauth-toolkit

# In settings.py
INSTALLED_APPS = [
    ...,
    'django_oauth_toolkit',
]

# In urls.py
from django_oauth_toolkit import urls
urlpatterns = [
    path('o/', include(urls)),
]

Requires Django 4.2, 5.0, 5.1, 5.2 or 6.0; Python 3.10 or later; oauthlib 3.2.2 or later.

Verify before relying

  • Whether the package supports custom OAuth2 grant types beyond standard flows.
  • Performance characteristics under high token request volume.
  • Specific token storage backend options and scalability trade-offs.
  • Full scope of token refresh and revocation capabilities.

Package facts

License Copyright (c) 2013, Massimiliano Pippi, Federico Frenguelli and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 5 — django, requests, urllib3, oauthlib, jwcrypto
Maintenance actively maintained — 21 days since the last release
Last repo commit
First released
Downloads 5,223,762/month — #2,136 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_oauth_toolkit-3.4.0-py3-none-any.whl

Keywords: django, oauth, oauth2, oauthlib

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP

Tags

django oauth2 provideroauth2 authorization server djangodjango api authentication oauthtoken management djangooauth2 endpoints djangorfc compliant oauthdjango oauth toolkit
oauth2-providerdjango-extensionauthentication

More WWW/HTTP packages