Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7517227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:22:41+00:00 2026-05-30T01:22:41+00:00

I am relatively new with Django and it’s ecosystem. I am writing REST api

  • 0

I am relatively new with Django and it’s ecosystem. I am writing REST api for our mobile client using django-tastypie. I have gone through almost all the examples on the web about how to use tastypie for creating REST interfaces. but none of them are specific to POSTing the data from client and how would you authorize a client.

I used the from tastypie.authentication.BasicAuthentication as show in the example. It opens a pop up asking username and password and works fine on the browser. But I am not sure, if it will do the same thing on mobile (to be specific, native IOS app). I am not quite getting when a user will make a request to login how this popup will be shown there on his/her mobile device if he or she is not using the browser but the native app.

I am totally lost on this, I would really appreciate your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:22:44+00:00Added an answer on May 30, 2026 at 1:22 am

    Thanks for the help.

    I used similar approach mentioned by @Iurii. Here is my solution.

    I wrote a class for handling the authentication and override is_authenticated method. and then I can use this class in Meta definition of tastypie resource classes.

    
        from tastypie.authentication import BasicAuthentication
        from tastypie.resources import Resource, ModelResource
    
        # class for handling authentication
        class MyAuthentication(BasicAuthentication):
            def is_authenticated(self, request, **kwargs):
                # put here the logic to check username and password from request object
                # if the user is authenticated then return True otherwise return False
    
        # tastypie resource class
        class MyResource(ModelResource):
            class Meta:
                authentication = MyAuthentication()
    
    

    this will ensure a request to access the resource will go through your authentication code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am relatively new to django. I have defined my db schema and validated
I'm still relatively new to Django and have just started poking around at Django-CMS,
I'm relatively new to Nant, what i'd like to do is have a task
I'm relatively new to Django and I'm designing a website that primarily needs usability
Im relatively new to PHP but have realized it is a powerfull tool. So
I'm new to Python (relatively new to programing in general) and I have created
I'm relatively new to python/django. I'm having an issue with sending to IDs through
Relatively new to using database and for some reason I can't get this 'execute'
Relatively new to C# and MVVM, but I'm making a WP7 app using the
I'm relatively new to Django and OO, so I may be missing something obvious,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.