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

  • Home
  • SEARCH
  • 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 8423317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:41:34+00:00 2026-06-10T03:41:34+00:00

Can not find what I’m doing wrong (I guess it should be some syntax

  • 0

Can not find what I’m doing wrong (I guess it should be some syntax error). My pictures does not showing up. I’m getting “NO FILES”.

html

    <!-- RECENTLY ADDED FILES -->
        <div class="buttom-box floatleft">
            <h3>Recently Added Files</h3>
                <p>New class papers. Now you can enjoy and study them</p>
                <br>
                {% if recent_files %}
                    {% for file in recent_files %}
                        <img src="{{ MEDIA_URL }}{{ file.image }}" alt="Sample 1" width="125" height="125" />
                    {% endfor %}
                {% else %}
                    <p>NO FILES</p>
                {% endif %}
        </div>

views.py

def index(request):  
    recent_files = FileDescription.objects.all()

    context_instance=RequestContext(request)
    return render_to_response('index.html', 
        {'recent_files':recent_files,},
        context_instance,
        )

MySQL for FileDescription:

mysql> SELECT * FROM school_filedescription;
+----+------------+--------------+-----------+------------------+-----------+------------------+---------------------+---------------------+-----------------------------+
| id | subject_id | subject_name | file_type | file_uploaded_by | file_name | file_description | file_creation_time  | file_modified_time  | image                       |
+----+------------+--------------+-----------+------------------+-----------+------------------+---------------------+---------------------+-----------------------------+
|  1 |          1 | Math 140     | class     | rrr              | lalala    | lalala           | 2012-08-23 12:12:12 | 2012-08-23 12:12:12 | files/rrr/class/smart.jpg   |
|  2 |          1 | Math 140     | class     | rrr              | ,s,s,s    | s msms           | 2012-08-23 12:32:39 | 2012-08-23 12:32:39 | files/rrr/class/smart_1.jpg |
+----+------------+--------------+-----------+------------------+-----------+------------------+---------------------+---------------------+-----------------------------+
2 rows in set (0.00 sec)

However this code in the other page works fine

other page:

{% extends "base.html" %}
{% block main-menu %}
    <div class="contentarea">       
        <img src="{{ MEDIA_URL }}{{ picture.image }}"/>
    </div>
{% endblock %}
  • 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-10T03:41:35+00:00Added an answer on June 10, 2026 at 3:41 am

    Try adding the recent file parameter to your request context instance, like this:

    context_instance = RequestContext(request, {
      'recent_files': recent_files
    })
    

    and then call the request like this…

    return render_to_response('index.html', context_instance = context_instance)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can not find out what is wrong that i am getting the error
I'm getting this error message in the index.jsp file Can not find the tag
I think that my issue should be really simple, yet I can not find
Just can not find how to install root certificate on Windows Phone 7. Does
Problem is that onkeydown=doSearch gives error that can not find dosearch function which is
I'm receiving this error on my jsp file - 'Can not find the tag
I can not find how to implement a design in C++. In the language
I can not find a mod_go for deploying Go web applications. Is there any
I faced a problem that I can not find a way to change the
Pretty basic question ... I can not find the compatibility table (was looking at

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.