views:

221

answers:

2

Now that Google App Engine natively supports Django 1.0, I updated with the following code:

from google.appengine.dist import use_library

use_library('django', '1.0')

I am now getting template errors relating to template inheritance.

For instance, if I have:

{% extends "../base.html" %}

Referring to a base.html in the parent directory, this worked as expected in Django 0.96, but Django 1.0 is unable to find the referenced template.

The Django docs (http://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance) don't mention any difference between versions....

A: 

The main difference in template inheritance from 0.96 and 1.0 was simply that if you use {% extends %}, it must be the first line in the template.

If that's not the problem, please post the traceback so we can see what's going on.

Daniel Roseman
+2  A: 

I dont think you can use relative imports in template inheritance. Thats your problem. You need to specify how it can be found relative to TEMPLATES_DIR(or applicationdirectory/templates)

uswaretech
This was the problem, the Django docs don't seem to make it clear that this is a difference between 0.96 and 1.0.
jamtoday
Probably obvious, but for the record and for Google's benefit, this applies to Django 1.1 also.
jhs