回答編集履歴
1
修正
answer
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
多分index.htmlは読み込まれていますが、その中で読み込もうとしているbase.htmlが読み込まれていません。 {% extends ... %} でbaseのhtmlを読み込むとき、...は mysite/hello/templates/...
|
|
1
|
+
多分index.htmlは読み込まれていますが、その中で読み込もうとしているbase.htmlが読み込まれていません。 {% extends ... %} でindex.htmlの位置からbaseのhtmlを読み込むとき、...は mysite/hello/templates/... の位置から読み込まれます。
|
|
2
2
|
普通、baseのhtmlはアプリごとにある(読み込むcssやjsを変えるから)ので、
|
|
3
3
|
│└templates/
|
|
4
4
|
│ └hello/
|
|
5
5
|
│ └index.html
|
|
6
6
|
│ └base.html # index.htmlと同じディレクトリ
|
|
7
7
|
ここにbaseを入れて、
|
|
8
|
+
index.htmlを
|
|
8
9
|
```HTML
|
|
9
10
|
<!-- index.html -->
|
|
10
11
|
{% extends 'hello/base.html' %}
|