Created
August 1, 2011 00:11
-
-
Save dstufft/1117376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tastypie.authentication import BasicAuthentication as TastypieBasicAuthentcation | |
from django.contrib.auth.models import AnonymousUser | |
class BasicAuthentication(TastypieBasicAuthentcation): | |
""" | |
Subclass Basic Authentcation to allow Anonymous users. | |
""" | |
def is_authenticated(self, request, **kwargs): | |
print request.user | |
if not request.META.get("HTTP_AUTHORIZATION"): | |
if request.method == "GET": | |
return True | |
return super(BasicAuthentication, self).is_authenticated(request, **kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment