回答編集履歴

1

回答を追記

2020/04/22 05:04

投稿

hasami
hasami

スコア1277

answer CHANGED
@@ -1,5 +1,15 @@
1
1
  外している可能性が高いですが、book/urls.pyに下記を追加するとどうなりますか?
2
2
  ```python
3
3
  app_name = 'book'
4
+ ```
5
+ また、「TemplateDoesNotExist at /book/list/」となる件についてですが、mysite/settings.pyのTEMPLATESリスト内の辞書に、 「'APP_DIRS': True,」はありますか?
6
+ もし、ある場合はエラーページに、Djangoがどのディレクトリにあるテンプレートを探しているかを示すログが出力されますので、その部分を確認してください。
4
7
 
8
+ ```python
9
+ TEMPLATES = [
10
+ {
11
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
12
+ 'DIRS': [os.path.join(BASE_DIR, 'templates')],
13
+ 'APP_DIRS': True,
14
+ # snip
5
15
  ```