Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_oauth_toolkit-3.4.1.tar.gz (256.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_oauth_toolkit-3.4.1-py3-none-any.whl (164.0 kB view details)

Uploaded Python 3

File details

Details for the file django_oauth_toolkit-3.4.1.tar.gz.

File metadata

  • Download URL: django_oauth_toolkit-3.4.1.tar.gz
  • Upload date:
  • Size: 256.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_oauth_toolkit-3.4.1.tar.gz
Algorithm Hash digest
SHA256 c4de73c0765eed55a99ea0fa8433b20664dcc1f43930149cff569abed166c5c2
MD5 a3fb68dc3603711b0e959197ec91a7de
BLAKE2b-256 6642b3c6a5d7e204011a702cc02ababb756d10538645dfd188ea441e4c65a082

See more details on using hashes here.

File details

Details for the file django_oauth_toolkit-3.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_oauth_toolkit-3.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c47f2a70e83bade0a47a5e9b20e86030d8ed9c0a8f10ec4ed30446cad7291f2d
MD5 3ddac51bb572f30277a27ffa0f0aada7
BLAKE2b-256 c41611cf2eacd7ac1c32908288b6d56fadef5676071a4ac0af7e626fd1abd3ef

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.4.1 This release

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.1.0rc1

2 files

3.0.1

2 files

3.0.0

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

1 file

2.0.0

2 files

1.7.1

2 files

1.7.0

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.3

2 files

1.3.2

2 files

1.3.0

2 files

1.2.0

1 file

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

1 file

0.12.0

2 files

0.11.0

2 files

0.10.0

1 file

0.9.0

1 file

0.8.2

1 file

0.8.1

1 file

0.8.0

1 file

0.7.2

1 file

0.7.1

1 file

0.7.0

1 file

0.6.1

1 file

0.6.0

1 file

0.5.0

1 file

0.4.1

1 file

0.4.0

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.1

1 file

0.2.0

1 file

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page