I've already configured the necessary things to work the extends template function in django. here's my codes:
def my_dir():
import os.path
return os.path.abspath(os.path.dirname(__file__))
TEMPLATE_DIRS = ( my_dir() + '/app/templates', ) #dynamic template directory
....
<div id="SideBar" class="FloatLeft">
{% block sidebar %} {% endblock %}
</div>
....
{% extends "site/base.html" %}
{% block sidebar %}
some code here
{% endblock %}
I've tried also the {% include "site/sidebar.html"%} tag in the base.html to check the template directory, and yes include tag is working...
what's the problem in the {% extends %} ? why does it doesnt detect its parent template..
please help me guys.. your help is greatly appreciated... im still waiting for the answer.. tnx
Which template are you rendering in your view? It should be the child, not the parent.
I am not sure what yout problem is, but you should check the following points :
These are the problems I can imagine, but I can't guarantee that it will work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With