skip to navigation
skip to content

Not Logged In

django-oauthost 0.3.0

This reusable Django application introduces OAuth2 server functionality.

What’s that

django-oauthost is a reusable application for Django, introducing OAuth2 server.

It allows to guard your application views with OAuth 2.0 in quite a trivial way.

  1. Register your client using Django Admin or API:

    from oauthost.toolbox import register_client
    # Define some scopes to restrict our client to.
    my_scopes = ['polls:vote']
    # `user` might be `request.user` if in a view.
    register_client('My OAuth Client', 'my_client', '', user, scopes_list=my_scopes)
  2. Decorate your views with oauth_required (suppose in polls.views):

    from oauthost.decorators import oauth_required
    def vote(request, poll_id, variant_id):
  3. Attach oauthost.urls to project urls (in

    from oauthost.urls import urlpatterns as oauthost_urlpatterns
    urlpatterns = ...  # Your actual urlpatterns are ommited.
    urlpatterns += oauthost_urlpatterns

    After that authorization endpoint is available at { BASE_URL }auth/.

    Token endpoint is available at { BASE_URL }token/.

That’s all for oauthost, connect using your client.

More information is available, read the docs!

File Type Py Version Uploaded on Size
django-oauthost-0.3.0.tar.gz (md5) Source 2014-06-10 41KB
  • Downloads (All Versions):
  • 27 downloads in the last day
  • 104 downloads in the last week
  • 492 downloads in the last month