teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

回答内容が変更になったため

2020/01/07 02:18

投稿

tatamyiwathy
tatamyiwathy

スコア1045

answer CHANGED
@@ -1,1 +1,27 @@
1
+ 対処1
2
+ ```
1
- ```http://127.0.0.1:8000/```ではなく```http://127.0.0.1:8000/mnist/```にしてください。
3
+ http://127.0.0.1:8000/mnist/
4
+ ``` にアクセスしてください。
5
+
6
+
7
+ 対処2
8
+
9
+ settings.pyのTEMPLATESでtemplatesディレクトリの位置を指定してください。
10
+
11
+ ```python
12
+ TEMPLATES = [
13
+ {
14
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
15
+ 'DIRS': [os.path.join(BASE_DIR, 'templates')], #templatesディレクトリの指定
16
+ 'APP_DIRS': True,
17
+ 'OPTIONS': {
18
+ 'context_processors': [
19
+ 'django.template.context_processors.debug',
20
+ 'django.template.context_processors.request',
21
+ 'django.contrib.auth.context_processors.auth',
22
+ 'django.contrib.messages.context_processors.messages',
23
+ ],
24
+ },
25
+ },
26
+ ]
27
+ ```