Looks like I posted too soon. Apparently my third solution above
*only* works on the index page. Clicking on a model page from there
reverts the view back to the default template. So I am looking for
any solution to this problem that doesn't involve modifying every
admin-site template.
Thanks,
- Matt
On Nov 2, 12:58 pm, Matt Brown <[EMAIL PROTECTED]> wrote:
> I'm wondering if I did the right thing, here. I wanted to replace the
> admin/base_site.html template, but only for requests to /myapp/admin/
> *, leaving requests to /admin/* alone.
>
> The first thing I tried was a copy/modify of base_site.html to myapp/
> templates/admin/myapp/, but the modifications weren't in effect on the
> index page -- not the desired outcome.
>
> Then I tried a hack that added myapp's templates directory to
> TEMPLATE_DIRS at runtime, which did have the effect I want in /myapp/
> admin, but it also overrode the templates on requests to /admin. Not
> the desired outcome.
>
> (After some reading, I believe I understand why I didn't get what I
> want on the above two attempts.)
>
> Lastly, I tried creating a AdminSite subclass that pointed to a custom
> index page: admin/index_myapp.html, which now extends a custom base-
> site template: admin/base_site_myapp.html. This gives me what I want:
> it leaves /admin/ requests alone and overrides the templates for /
> myapp/admin/. It does have the drawback, though, of having to
> maintain my own [largely unchanged] copy of the admin-index template,
> which means possibly having to keep track of changes to Django's admin-
> index template with each new Django release.
>
> Is there a better method for replacing base_site.html on requests to
> app-specific urls, that doesn't involve duplicating the index page?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---