My problem started when the extends tag in a Django template could not reference a base template in a parent dir. This question1 has a very good answer to the problem, but it disables the implicit template caching provided by the default template.render function in appengine.
The author of the answer also mentions that it would be fairly simple to implement this template caching, but I feel tampering with this kind of functionality will produce bugs in the future. Any suggestions?
All of our template dirs are sub-folders of one template dir, so we just needed to get the loader to look there first.
I haven’t tested if/how this breaks the template caching, but it doesn’t change the behaviour AFAICT.
We did it by extending the base loader with a module
alternative_path.pylike this:Then in the same module:
_loader = LoaderThen in
main.py: