1

I keep getting TemplateDoesNotExist and I can't figure out how to debug it. I've added the folder in which the template sits into the TEMPLATE_DIRS tuple and when I call get_template from within my .py file, the template loads fine, however when I call it from within a template fine using the extends tag, it raises TemplateDoesNotExist.

The template file isn't under a static_files path in the app.yaml.

What confuses me is why it loads fine with get_template but not with extend.

Is there a way I can find out the path in which Django is looking?

Ahmed Nuaman
  • 12,662
  • 15
  • 55
  • 87

1 Answers1

0

You might try:

from django.conf import settings
print settings.TEMPLATE_DIRS

to see the used template dir path.

Thomas Kremmel
  • 14,575
  • 26
  • 108
  • 177
  • This returns the correct paths. Is there a way to find out the path which is causing the `TemplateDoesNotExist` in question? – Ahmed Nuaman Aug 20 '12 at 13:31
  • Not sure, but the answer to this question might help you: http://stackoverflow.com/questions/3038459/django-template-path . It shows you how to setup the template_dirs setting correctly. You might have an issue there. – Thomas Kremmel Aug 20 '12 at 13:40
  • If this does not help, you could also try (for debugging purposes) the django.template.loaders.app_directories.Loader, for which the docs can be found here: https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types - it loads the templates from a template folder below your app folder. It is enabled by default, but if not just add this string 'django.template.loaders.app_directories.Loader' to your TEMPLATE_LOADERS setting. – Thomas Kremmel Aug 20 '12 at 13:46