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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:39:25+00:00 2026-05-26T06:39:25+00:00

I am trying to display the image and name in a for loop on

  • 0

I am trying to display the image and name in a for loop on my template.

This is what I have on my template for loop, and I thought it should work, but it doesn’t

{% for op in tracked_objects %}
           {%  if op.is_mine %}
           <div style="float:left;">
               <div>
                   <img src="{{ op.tracked_object.image }}" alt="">
                    <a href='{% url track-profile op.tracked_object.id %}'>{{ op.tracked_object }}</a><br>
               </div>
           </div>
           {% endif %}
{% endfor %}

I know that op.is_mine is true because the Name shows.

Here is my views.py:

@login_required
def profile(request):
   user = request.user
   tracked_objects = user.tracked_object_perms.all().order_by('is_mine',)
   context = {
       'tracked_objects':tracked_objects,
   }
return render_to_response( 'accounts/profile.html' , RequestContext(request, context))

and finally the models.py

name = models.CharField(max_length='140')
image = models.ImageField(upload_to='img/tracked_object_images', null=True, blank=True)

Update

Now when I use the below anser of adding the .url onto the end, I get three broken image icons. Now I have checked the path and it goes to the correct image. Would this be a server issue possibly? Or something along those lines?

  • 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-26T06:39:25+00:00Added an answer on May 26, 2026 at 6:39 am

    Try:

    <img src="{{ op.tracked_object.image.url }}" alt="">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to display image from database using php but i am
I am trying to display an image instead of its name in my list_display
I have Custom List to display image with it's name like below... public class
So I'm trying to display an image that is ouside the path of my
I'm trying to display an update progress loading image whenever my update panel does
I am trying to display a bytearray as a resized image. The Image is
I am trying to make the image title display at the same time the
I am trying to create a wpf control that will display a map image
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
I've been trying to display text using a Quartz context, but no matter what

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.