Override a django third-party application template through extend

两盒软妹~` 提交于 2019-12-13 00:45:33

问题


I'm using third-party apps (through Pinax), and I am trying to override a template file that the third-party template extends from.

That is --

Third party app:
    templates/app/a.html
    templates/base.html

My project:
    templates/app/b.html
    templates/base.html

Where I've copied and modified base.html from the third-party app for use in my own project and both the third-party app/a.html and my own app/b.html do {% extends "base.html" %}.

The current behavior is that when app/a.html extends base.html, it's currently loading the third-party base.html, while app/b.html is loading my own base.html. The preferred behavior is for both app/a.html and app/b.html to load my base.html.

Is there a way to set priority to my own template files?


回答1:


You could see django-templateloaderwithpriorities or django-smart-extends



来源:https://stackoverflow.com/questions/10565751/override-a-django-third-party-application-template-through-extend

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!