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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:26:28+00:00 2026-06-11T04:26:28+00:00

I am making my first Django application and am running into some AJAX issues.

  • 0

I am making my first Django application and am running into some AJAX issues. On my website, the user can see a gallery of photos. To get to this page, they merely need to go to /photos. The photos view calculates the photos to display and passes them to the template for rendering.

They can request to see more photos by clicking a button. Clicking this button sends an AJAX request to the server. The server calculates a new set of photos to display and then once again passes the photos to the same template for display. The only issue is that the photos on screen never change.

I verified that new photos are being calculated by the server. Unfortunately, lots of things that should happen never actually happen. First and foremost, using the Chrome developer tools, I can see that the photo files are never sent to the browser from the server. Furthermore, the DOM never updates the src attributes to refer to the new photos. What do I need to be doing to make these things happen?

Thank you.

EDIT:

Some code:

#The python view summarized
def photos:
    photoList = GetListOfPhotos() #Returns photo objects.  These objects have a file field which is access from the template.
        return render(request,
              'photos.html', 
             {'photoList': photoList}, 
              context_instance=RequestContext(request)
             )

#AJAX request
$(document).ready(function(){
    $("#right-arrow").click(function(event) {
        $.post("/photos/", {"arrow" : "right"
        });
    });
});
  • 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-06-11T04:26:30+00:00Added an answer on June 11, 2026 at 4:26 am

    The most suspicious thing to me is that you say

    once again passes the photos to the same template for display.

    Is this the EXACT same template your /photo url corresponds to? If it is you should probably be using a small subsection of it just to render the photos in a list or a table (or however you display them) Other than that there are a couple of things that can help resolve this.

    1. In chrome developer tools make sure that your javascript is sending the correct data. This can be done by verify your params in the net tab, and by liberal use of console log;

    2. Verify that your view is in fact doing what it is supposed to. I like pdb. It is perfect for this. You could write tests, or make print statments or w/e.

    3. Verify that your front end is recieving data. Chrome tools can help you do this. The net tab will let you see the response.

    I would like to be more specific but you haven’t provided specifics.

    To help with better answers its important to post all relevant code.

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

Sidebar

Related Questions

I'm making my first game in canvas/JS and I'm running into an issue with
I'm making my first iphone application and it's a wine chart application. It's with
I am making my first android application, and it requires switching between activities very
I am making my first major iPhone app and need some advice in saving
I am making my first web application with ASP.NET and I am having a
Still making my first steps in Ruby (while dealing with some written code). I
I am making my first program using Java3D. I have setup some transformGroups that
I'm making my first iOS app, and am in need of some help. Here
I'm in the middle of making my first django app, and I'd like to
I'm making some first steps in Typo3 and am currently trying to make a

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.