django-tastypie-two-legged-oauth icon indicating copy to clipboard operation
django-tastypie-two-legged-oauth copied to clipboard

Simple 2-legged OAuth authentication model for django tastypie.

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()