Take the 2-minute tour ×

I am now quite familier with tastypie , it is tightly coupled with authorization and authentication.

Is there anyway to login from page at another location that could be used for authorization, rather than having the tasty pie auth pop up?

When user will make a request to login how this popup will be shown there on their mobile device if they are not using the browser but the native app.

it is saying 401 Unauthorised

The sample code which i tried is below

class MyAuthentication(BasicAuthentication):
    def is_authenticated(self, request, **kwargs):
        from django.contrib.auth import authenticate
        #for now i tried static but still not working are return types correct     
        def is_authenticated(self, request, **kwargs):
            from django.contrib.auth import authenticate
            user = authenticate(username='admin', password='admin')

            if user is not None:
               if user.is_active:
                  return True
                 return self._unauthorized()
                return self._unauthorized()

class EntryResource(ModelResource):
    class Meta:
        queryset = Entry.objects.all()
        resource_name = 'entry'
        #authorization = Authorization()
        authorization = DjangoAuthorization()
        authentication = MyAuthentication()

    filtering = {
        'user': ALL_WITH_RELATIONS,
        'pub_date': ['exact', 'lt', 'lte', 'gte', 'gt'],
share|improve this question
add comment

1 Answer

on the django-tastypie official docs they say never to use authorization for production deployment, so there must be a workaround with djangoauthorization

share|improve this answer
add comment

Your Answer


