Skip to content

Instantly share code, notes, and snippets.

@bohde
Created December 24, 2010 15:17
Show Gist options
  • Save bohde/754329 to your computer and use it in GitHub Desktop.
Save bohde/754329 to your computer and use it in GitHub Desktop.
Django based auth for Tastypie
from tastypie.authentication import Authentication
class DjangoAuthentication(Authentication):
"""Authenticate based upon Django session"""
def is_authenticated(self, request, **kwargs):
return request.user.is_authenticated()
@tvaughan
Copy link

@bohde
Copy link
Author

bohde commented Dec 18, 2011

It looks like they've recreated what the auth middleware does. As long as you are using the auth middleware, these should be equivalent.

@tvaughan
Copy link

Awesome. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment