How to override and extend basic Django admin templates?

前端 未结 11 1026
长发绾君心
长发绾君心 2020-11-22 14:11

How do I override an admin template (e.g. admin/index.html) while at the same time extending it (see https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-r

11条回答
  •  深忆病人
    2020-11-22 14:42

    You can use django-overextends, which provides circular template inheritance for Django.

    It comes from the Mezzanine CMS, from where Stephen extracted it into a standalone Django extension.

    More infos you find in "Overriding vs Extending Templates" (http:/mezzanine.jupo.org/docs/content-architecture.html#overriding-vs-extending-templates) inside the Mezzanine docs.

    For deeper insides look at Stephens Blog "Circular Template Inheritance for Django" (http:/blog.jupo.org/2012/05/17/circular-template-inheritance-for-django).

    And in Google Groups the discussion (https:/groups.google.com/forum/#!topic/mezzanine-users/sUydcf_IZkQ) which started the development of this feature.

    Note:

    I don't have the reputation to add more than 2 links. But I think the links provide interesting background information. So I just left out a slash after "http(s):". Maybe someone with better reputation can repair the links and remove this note.

提交回复
热议问题