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 4257572
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:31:49+00:00 2026-05-21T05:31:49+00:00

I am in the process of researching the best design-pattern a web API. I

  • 0

I am in the process of researching the best “design-pattern” a web API. I am currently using Django as my web framework. I created a non-ajax interface that causes the entire page to reload at each request.

Now, I am starting incorporate ajax into the interface. For the sake of this discussion, two example pieces of functionality that I need to add an API for are the following

1) beta page: the user supplies an email address. i want to make an ajax call to the serverside to see if it already exists in my DB. my initial design for this call would be a view function similar to

def check_email(request):
    if request.method == "POST":
           # check db

           # return JSON true/false

2) profile picture uploads, where the new profile picture is added to your page without a full page reload

as far as i can tell, the best way to do this is via a POST call to a view function. then, the response would return JSON, which I can then inject back into the DOM accordingly.

can someone please let me know if I am on the right track with designing this API?

note: i have checked out django-piston, and it seems pretty useful also.

thanks

  • 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-21T05:31:49+00:00Added an answer on May 21, 2026 at 5:31 am

    You’re right on track, but I would use request.is_ajax() to check if it’s actually a ajax request to return the response accordingly. from the django request docs

    Returns True if the request was made via an XMLHttpRequest, by checking the HTTP_X_REQUESTED_WITH header for the string ‘XMLHttpRequest’. Most modern JavaScript libraries send this header. If you write your own XMLHttpRequest call (on the browser side), you’ll have to set this header manually if you want is_ajax() to work.

    This will allow you to separate return values for users that have javascript disabled, allowing them to still use your site correctly. If you’re not using a javascript library, you set this yourself.

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

Sidebar

Related Questions

I'm currently in the process of researching the best development and deployment practices for
I'm currently researching ways to hook a process and take control of it using
I am in the process of researching/comparing CXF and Spring-WS for web services? I
There is a conversion process that is needed when migrating Visual Studio 2005 web
A Windows process created from an exe file has access to the command string
I’m in the process of researching if and how a Windows Mobile .NET application
I am in the process of researching/setting up a Continuous Integration Server for a
I'm currently researching ways to speed up and scale up a long running matching
Java process control is notoriously bad - primarily due to inadequate support by the
I'm in the process of refactoring some code which includes moving folders around, and

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.