REST Framework OAuth

OAuth support for Django REST Framework


OAuth support extracted as a third party package directly from the official Django REST Framework implementation. It's built to use the django-oauth-plus, oauth2, and django-oauth2-provider packages.

This package provides two authentication classes, OAuthAuthentication and OAuth2Authentication, and a TokenHasReadWriteScope permission class.



Install using pip:

$ pip install djangorestframework-oauth

OAuth packages are optional and not installed out of the box. Use of OAuthAuthentication requires installation of the django-oauth-plus and oauth2 packages:

$ pip install django-oauth-plus oauth2

Use of OAuth2Authentication requires installation of django-oauth2-provider:

$ pip install django-oauth2-provider

Use of TokenHasReadWriteScope requires installation of either django-oauth-plus or django-oauth2-provider.

Documentation & Support

Full documentation for the project is available at

You may also want to follow the author on Twitter.


Install testing requirements.

$ pip install -r requirements.txt

Run with runtests.

$ ./

You can also use the excellent tox testing tool to run the tests against all supported versions of Python and Django. Install tox globally, and then simply run:

$ tox


To build the documentation, you'll need to install mkdocs.

$ pip install mkdocs

To preview the documentation:

$ mkdocs serve
Running at:

To build the documentation:

$ mkdocs build