質問編集履歴
1
Chrome上エラーの追加、views.pyの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,9 +14,11 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
`SyntaxError: The string did not match the expected pattern.
|
17
|
+
Safari上のエラー`SyntaxError: The string did not match the expected pattern.`
|
18
|
-
|
18
|
+
|
19
|
-
`
|
19
|
+
Chrome上のエラー`SyntaxError: Unexpected token < in JSON at position 2`
|
20
|
+
|
21
|
+
|
20
22
|
|
21
23
|
下のソースコードのError2です。
|
22
24
|
|
@@ -142,6 +144,8 @@
|
|
142
144
|
|
143
145
|
|
144
146
|
|
147
|
+
urls.py
|
148
|
+
|
145
149
|
```Python
|
146
150
|
|
147
151
|
from django.urls import path
|
@@ -160,6 +164,46 @@
|
|
160
164
|
|
161
165
|
|
162
166
|
|
167
|
+
views.py
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
```Python
|
172
|
+
|
173
|
+
from django.shortcuts import render
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
def index(request):
|
178
|
+
|
179
|
+
if request.method == "GET":
|
180
|
+
|
181
|
+
return render(
|
182
|
+
|
183
|
+
request,
|
184
|
+
|
185
|
+
"home.html",
|
186
|
+
|
187
|
+
)
|
188
|
+
|
189
|
+
else:
|
190
|
+
|
191
|
+
return render(
|
192
|
+
|
193
|
+
request,
|
194
|
+
|
195
|
+
"home.html",
|
196
|
+
|
197
|
+
{"title": 100}
|
198
|
+
|
199
|
+
)
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
```
|
204
|
+
|
205
|
+
|
206
|
+
|
163
207
|
### 試したこと
|
164
208
|
|
165
209
|
|