title: django tastypie custom login
body: <p>I am now quite familier with tastypie , it is tightly coupled with authorization and authentication.</p>
  
  <p>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?</p>
  
  <p>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.</p>
  
  <p><strong>it is saying 401 Unauthorised</strong></p>
  
  <p>The sample code which i tried is below</p>
  
  <pre><code>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
                 else:
                   return self._unauthorized()
              else:
                  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'],
          }
  </code></pre>