views:

68

answers:

1

hi, i am having issues with my django templating system, i have a base.html file, which contains the content which will be common on all the web pages of the web site, the base.html file fetches some dynamic content, like the categories and the archives, which are passed to it by a python file, which fetches the categories and the archives data from a mysql database.

the issue when i inherit this base.html file in other html files like index.html:

{% extends "base.html" %}

and when when i call the main index URL for ex: http://mywebsite.com/index/

the index page gets loaded, but the categories and the archives data that should get loaded from the base.html file does not.

what am i doing wrong, please help.

+3  A: 

Most likely you have one (or both) of these issues:

  1. The block in base.html is being overridden with a block in the index.html, and you haven't used {{block.super}} to include the content from the base template.

  2. The view function that invokes index.html isn't creating the proper context variables to give the template the data it needs.

Ned Batchelder
no, that didn't help, the issue is, there is a simple line below the code i have posted above <img src="http://mywebsite.com/media/cellpassion/images/adv-sony.jpg" /></a><img src="http://mywebsite.com/media/cellpassion/images/adv-LG.jpg" />both these lines are in the base.html file and they are getting loaded, but the code above that is the data that should loaded the categories, is not getting loaded.i am really tired, trying to solve the issue from past 2 days.
Suhail
Suhail, you're going to have to post more code, then. The problem is probably simple, but we don't have enough information.
Ned Batchelder
can i mail you the python and the html files ?
Suhail
Is there a reason you don't just paste code here? If it is too large, then perhaps you need to whittle it down anyway.
Ned Batchelder