我正在尝试将 django应用程序合并到一个网站中,其中静态html占大多数.
目录结构如下.
root/
├ var/
│ └ www/
│ ├ html/
│ ├ static
│ │ ├style.css
│ │ ├base.js
│ │
│ ├ web/
│ ├head.html
│ ├footer.html
│ ├base.html
│
└ opt/
└ django/
├ project/
│
├ apps/
├ ├ views.py
├ template/
├ index.html
我想让/opt/django/template/index.html在/ var / www / html / web /中读取html.
我不知道如何包括.
{%include“/var/www/html/web/head.html”%}没用.
我不想改变目录结构.
最佳答案 将此视为您的目录结构:
root/
├ var/
│ └ www/
│ ├ html/
│ ├ static
│ │ ├style.css
│ │ ├base.js
│ │
│ ├ web/
│ ├head.html
│ ├footer.html
│ ├base.html