I came across a subtle gotcha with template overriding in magic-removal
today. It stems from these two facts:

1. loaders stop at the first match
2. the admin is now just another app in INSTALLED_APPS

The resulting gotcha: to override admin templates your app must appear
*before* django.contrib.admin in INSTALLED_APPS.

You could "fix" this by telling people to be careful about the sequence
of INSTALLED_APPS; kind of fussy, though potentially useful. If this
route is chosen then Tutorial 2 needs to be updated to make this issue
more explicit.

Alternatively you could have django.template.loaders.app_directories
iterate over a re-ordered INSTALLED_APPS:

    ...
    django_apps = [app for app in settings.INSTALLED_APPS if
app.startswith('django.')]
    other_apps = [app for app in settings.INSTALLED_APPS if not
app.startswith('django.')]
    for app in other_apps + django_apps:
        ...

That's my preference, because I think that it makes sense for user
templates to always override Django templates. But I don't know much
about the other loader types and how this might interact with them.

pb


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to