Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

extend base.html problem

I'm getting the following error:

Template error

In template /home/mo/python/django/templates/yoga/index.html, error at line 1
Caught TemplateDoesNotExist while rendering: base.html
1 {% extends "base.html" %}
2 
3 {% block main %}
4     <p>{{ page.title }}</p>
5     <p>{{ page.info}}</p>
6     <a href="method/">Method</a>
7 {% endblock %}
8 

this is my base.html file, which is located at the same place as index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <div style="width:50%; marginleft:25%;">
    {% block main %}{% endblock %}
    </div>

what exactly is going on here? should the base.html file be located somewhere else?

like image 686
momo Avatar asked Jun 17 '10 23:06

momo


1 Answers

"At the same place" as yoga/index.html means that the template is actually yoga/base.html.

like image 117
Ignacio Vazquez-Abrams Avatar answered Sep 18 '22 20:09

Ignacio Vazquez-Abrams