Skip to main content

Django OAuth Toolkit

OAuth2 goodies for the Djangonauts!

https://badge.fury.io/py/django-oauth-toolkit.svg GitHub Actions Coverage Supported Python versions Supported Django versions

Django OAuth Toolkit is an OAuth 2.0 authorization server for teams already running Django. It provides, out of the box, the endpoints, models, and logic to issue and manage OAuth2 tokens from your existing Django project, instead of standing up and operating a separate service.

As of 3.4.0, Django OAuth Toolkit supports the authorization server role required by the Model Context Protocol (MCP) authorization specification: PKCE is required by default, and the authorization server metadata (RFC 8414) and protected resource metadata (RFC 9728) discovery endpoints are included in the default URLconf. Dynamic Client Registration (RFC 7591/7592) and Client ID Metadata Documents can be enabled with the DCR_ENABLED and CIMD_ENABLED settings. See the 3.4.0 release discussion for the supported specifications and current gaps.

Django OAuth Toolkit can also act as a resource server to protect a Django or Django REST Framework API with OAuth2. It makes extensive use of the excellent OAuthLib, so that everything is rfc-compliant.

Reporting security issues

Please use GitHub’s private vulnerability reporting form and follow the repository security policy. Do not file a public issue or pull request for an undisclosed vulnerability. If private reporting is unavailable, email the Django OAuth security team.

Requirements

  • Python 3.10, 3.11, 3.12, 3.13 or 3.14

  • Django 4.2, 5.0, 5.1, 5.2 or 6.0

  • oauthlib 3.2.2+

Installation

Install with pip:

pip install django-oauth-toolkit

Add oauth2_provider to your INSTALLED_APPS

INSTALLED_APPS = (
    ...
    'oauth2_provider',
)

If you need an OAuth 2.0 authorization server you’ll want to add the following to your urls.py.

from oauth2_provider import urls as oauth2_urls

urlpatterns = [
    ...
    path('o/', include(oauth2_urls)),
]

Changelog

See CHANGELOG.md.

Documentation

The full documentation is on Read the Docs.

License

django-oauth-toolkit is released under the terms of the BSD license. Full details in LICENSE file.

Help Wanted

We need help maintaining and enhancing django-oauth-toolkit (DOT).

Join the team

There are no barriers to participation. Anyone can open an issue, pr, or review a pull request. Please dive in!

How you can help

See our contributing info and the open issues and PRs, especially those labeled help-wanted.

Discussions

Have questions or want to discuss the project? See the discussions.

Submit PRs and Perform Reviews

PR submissions and reviews are always appreciated! Since we require an independent review of any PR before it can be merged, having your second set of eyes looking at PRs is extremely valuable.

Become a Maintainer

If you are interested in stepping up to be a Maintainer, please open an issue. For maintainers we’re looking for a positive attitude, attentiveness to the specifications, strong coding and communication skills, and a willingness to work with others. Maintainers are responsible for merging pull requests, managing issues, creating releases, and ensuring the overall health of the project.

Release files for django-oauth-toolkit 3.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-oauth-toolkit 3.4.1
File Size Uploaded
django_oauth_toolkit-3.4.1.tar.gz 256.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-oauth-toolkit 3.4.1
File Interpreter ABI Platform
django_oauth_toolkit-3.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 420.1 kB

Release files / django_oauth_toolkit-3.4.1.tar.gz

Download URL django_oauth_toolkit-3.4.1.tar.gz
Size 256.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c4de73c0765eed55a99ea0fa8433b20664dcc1f43930149cff569abed166c5c2
BLAKE2b-256 checksum
How to use checksums
6642b3c6a5d7e204011a702cc02ababb756d10538645dfd188ea441e4c65a082
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / django_oauth_toolkit-3.4.1-py3-none-any.whl

Download URL django_oauth_toolkit-3.4.1-py3-none-any.whl
Size 164.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c47f2a70e83bade0a47a5e9b20e86030d8ed9c0a8f10ec4ed30446cad7291f2d
BLAKE2b-256 checksum
How to use checksums
c41611cf2eacd7ac1c32908288b6d56fadef5676071a4ac0af7e626fd1abd3ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

3.4.1 This release

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

1 release file

2.0.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.0

2 release files

1.2.0

1 release file

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

1 release file

0.12.0

2 release files

0.10.0

1 release file

0.9.0

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page