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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:18:03+00:00 2026-06-15T09:18:03+00:00

I am pretty new to Django and I encountered a problem with the media-grid

  • 0

I am pretty new to Django and I encountered a problem with the media-grid class of Twitter Bootstrap: instead of displaying a gallery, I am only able to make normal lists of images.

I am using Bootstrap 2.2.1 with Django 1.4.1 on Windows XP. I copied the Bootstrap files in my project folder and I made a very simple HTML template to test Bootstrap’s media-grid class. My goal is to visualize a simple gallery of images from my database.

The correct syntax for the media-grid class is defined here as:

<ul class="media-grid">
  <li>
    <a href="#">
      <img class="thumbnail" src="http://placehold.it/330x230" alt="">
    </a>
  </li>
  <li>
    <a href="#">
      <img class="thumbnail" src="http://placehold.it/330x230" alt="">
    </a>
  </li>
</ul>

However, if I copy and paste the same exact code in a simple HTML template, and load it via the render_to_response command in my views.py file, the resulting displayed page only contains a normal list of images, one per line, with a normal dot (as in every standard list) before every image. I am able to use Bootstrap’s classes with Django in the same project, and this makes me exclude I am not importing the css file correctly.

I have the feeling Django interprets the page without minding media-grid‘s syntax, and renders a list of images.

The simple HTML file I’m using is the following:

<!DOCTYPE html> 
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{% block title %}To be defined{% endblock %}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

<!-- Le styles -->
<link href="{{STATIC_URL}}css/bootstrap.css" rel="stylesheet">
<style>
  body {
      padding-top: 80px;        
      padding-bottom: 40px;     
  }
</style>
<link href="{{STATIC_URL}}css/bootstrap-responsive.css" rel="stylesheet">

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
 <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
 <script src="{{STATIC_URL}}js/jquery-1.8.1.min.js" type="text/javascript"></script>
   {% block extrahead %}
   {% endblock %}
 <script type="text/javascript">
   $(function(){
   {% block jquery %}
   {% endblock %}
   });
 </script>
</head>

<body>

  <ul class="media-grid">
    <li>
      <a href="#">
        <img class="thumbnail" src="http://placehold.it/330x230" alt="">
      </a>
    </li>
    <li>
      <a href="#">
        <img class="thumbnail" src="http://placehold.it/330x230" alt="">
      </a>
    </li>
  </ul>


</body>
</html>

I have tried to write it down differently, and unsuccessfully looked online for a solution for 2 days. If you have an idea of why this code may not be working, please let me know.

Thanks everyone in advance.

  • 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-15T09:18:04+00:00Added an answer on June 15, 2026 at 9:18 am

    If you are using Bootstrap version newer than v1.4, the ‘media-grid’ component has been renamed to ‘Thumbnails’.

    http://twitter.github.com/bootstrap/components.html#thumbnails

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

Sidebar

Related Questions

I'm pretty new with Django and the whole web-developing concept. I've only taken Java
Pretty new to MVC and the like. I have a class the looks like
I'm trying to move my gae webapp project to django non-rel. I'm pretty new
I am pretty new to Django and am trying to build a blog app
I'm pretty new to Django and I'm having some difficulty getting my settings.py to
I'm quite new with Django, and so far I have a pretty basic setup
I am pretty new to django, but have many years experience coding in the
I am pretty new to Django and wanted to know how I could check
I'm new to Django and have only been using sqlite3 as a database engine
I'm pretty new to Django and come from the PHP world. I'm trying to

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.