Django Template Debugging

When attempting to debug an admin template override (https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#overriding-admin-templates), I keep getting this error:

WARNING: Template path is not available. Please set TEMPLATE_DEBUG=True in your settings.py to make django template breakpoints working

I have it set. Here's the relevant parts of my settings.py:


DEBUG = True
TEMPLATE_DEBUG = DEBUG


TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    #'django.template.loaders.eggs.Loader',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.request",
    )

TEMPLATE_DIRS = ('/Users/jay/Projects/Python/Django/PADjango/templates',)


My template file:


{% extends "admin/change_form.html" %}
{% load i18n %}
{% block after_field_sets %}
    {% if not add %}
        <p>Here's some extra stuff to show but only when editing an existing record.</p>
    {% endif %}
{% endblock %}


My guess is that the debugger is getting confused because this template is extending the standard admin change template, located here:

django/contrib/admin/templates/admin/change_form.html

I've added the path (django/contrib/admin/templates), both relative and full path, to the TEMPLATE_DIRS tuple in settings.py but it's still not working. Is there some combination that I'm just not getting right?
1 comment
Problem solved. I had my template overrides in directories named for models (so they were model-specific). Turns out you shouldn't capitalize the directory name ("Customer" vs "customer") despite the fact that the model name is capitalized. Interesting that when deployed on my development machine the overrides loaded correctly but once I deployed to my production machine the overrides didn't work at all.
0

Please sign in to leave a comment.