Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.25 KB

File metadata and controls

37 lines (25 loc) · 1.25 KB

About

django-tastypie-two-legged-oauth is a simple 2-legged OAuth authentication model for Django Tastypie.

This nearly an exact copy of gregbayer/django-piston-two-legged-oauth, an OAuth connector for django-piston.

Dependencies:

Adapted from example:

Related discussions:

Example

# resources.py

from tastypie.resources import ModelResource
from tastypie.authorization import DjangoAuthorization
from django.contrib.auth.models import User
from authentication import TwoLeggedOAuthAuthentication

class UserResource(ModelResource):
	class Meta:
   		queryset = User.objects.all()
    	resource_name = 'users'
    	excludes = ['email', 'password', 'is_active', 'is_staff', 'is_superuser']
    	authorization = DjangoAuthorization()
    	authentication = TwoLeggedOAuthAuthentication()