From 7d553c0650a1dad73c98cf8cd9b8d13eb0633e56 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 19 Jul 2005 04:40:57 +0000 Subject: [PATCH] Improved TemplateDoesNotExist error message in django.core.template_file git-svn-id: http://code.djangoproject.com/svn/django/trunk@194 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/template_file.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/django/core/template_file.py b/django/core/template_file.py index 71139595ab..25862da55a 100644 --- a/django/core/template_file.py +++ b/django/core/template_file.py @@ -15,4 +15,8 @@ def load_template_source(template_name, template_dirs=None): return open(filepath).read() except IOError: tried.append(filepath) - raise TemplateDoesNotExist, str(tried) + if template_dirs: + error_msg = "Tried %s" % tried + else: + error_msg = "Your TEMPLATE_DIRS settings is empty. Change it to point to at least one template directory." + raise TemplateDoesNotExist, error_msg