django templates: include and extends

后端 未结 7 2021
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 10:37

I would like to provide the same content inside 2 different base files.

So I\'m trying to do this:

page1.html:

{% extends \"base1.html\" %}
         


        
7条回答
  •  醉话见心
    2020-12-07 11:16

    More info about why it wasn't working for me in case it helps future people:

    The reason why it wasn't working is that {% include %} in django doesn't like special characters like fancy apostrophe. The template data I was trying to include was pasted from word. I had to manually remove all of these special characters and then it included successfully.

提交回复
热议问题