Base template for all apps in Django

前端 未结 3 1219
渐次进展
渐次进展 2021-02-07 02:01

I have a project with 2 apps

project/
    blog/
        templates/
            index.html
    polls/
        templates/
            index.html
    project/
              


        
3条回答
  •  花落未央
    2021-02-07 02:34

    1. Add a templates directory at the project root, and add it to your TEMPLATE_DIRS setting.
    2. Add a base.html to that directory.
    3. Extend it wherever you want using {% extends 'base.html' %}

提交回复
热议问题