質問編集履歴
4
base.htmlの追加、投稿の整理、view.py、form.pyの削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,524 +8,536 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
+
|
12
|
+
|
11
|
-
### __
|
13
|
+
### __settings.py__
|
12
14
|
|
13
15
|
```python
|
14
16
|
|
15
|
-
from
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
n
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
't
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
e
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
17
|
+
from japweb.settings_common import *
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
# SECURITY WARNING: keep the secret key used in production secret!
|
22
|
+
|
23
|
+
DEBUG = True
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
ALLOWED_HOSTS = []
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
LOGGING = {
|
32
|
+
|
33
|
+
'version': 1,
|
34
|
+
|
35
|
+
'disable_existing_loggers': False,
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
'loggers': {
|
40
|
+
|
41
|
+
'django': {
|
42
|
+
|
43
|
+
'handlers': ['console'],
|
44
|
+
|
45
|
+
'level': 'INFO',
|
46
|
+
|
47
|
+
},
|
48
|
+
|
49
|
+
'diary': {
|
50
|
+
|
51
|
+
'handlers': ['console'],
|
52
|
+
|
53
|
+
'level': 'DEBUG',
|
54
|
+
|
55
|
+
},
|
56
|
+
|
57
|
+
},
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
'handlers': {
|
62
|
+
|
63
|
+
'console': {
|
64
|
+
|
65
|
+
'level': 'DEBUG',
|
66
|
+
|
67
|
+
'class': 'logging.StreamHandler',
|
68
|
+
|
69
|
+
'formatter': 'dev'
|
70
|
+
|
71
|
+
},
|
72
|
+
|
73
|
+
},
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
'formatters': {
|
78
|
+
|
79
|
+
'dev': {
|
80
|
+
|
81
|
+
'format': '\t'.join([
|
82
|
+
|
83
|
+
'%(asctime)s',
|
84
|
+
|
85
|
+
'[%(levelname)s]',
|
86
|
+
|
87
|
+
'%(pathname)s(Line:%(lineno)d)',
|
88
|
+
|
89
|
+
'%(message)s'
|
90
|
+
|
91
|
+
])
|
92
|
+
|
93
|
+
},
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
94
102
|
|
95
103
|
|
96
104
|
|
97
105
|
```
|
98
106
|
|
107
|
+
|
108
|
+
|
109
|
+
### 追記(Base.html)
|
110
|
+
|
111
|
+
```HTML
|
112
|
+
|
113
|
+
{% load static %}
|
114
|
+
|
115
|
+
<html lang="ja">
|
116
|
+
|
117
|
+
<head>
|
118
|
+
|
119
|
+
<meta charset="UTF-8">
|
120
|
+
|
121
|
+
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
122
|
+
|
123
|
+
<meta name="descripition" content="">
|
124
|
+
|
125
|
+
<meta name="author" content="">
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<title>{% block title %}{% endblock%}</title>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<!--Bootstrap core CSS-->
|
134
|
+
|
135
|
+
<link href="{% static 'vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
<!--Custom fonts for this template-->
|
140
|
+
|
141
|
+
<link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet">
|
142
|
+
|
143
|
+
<link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<!--Custom styles for this template-->
|
148
|
+
|
149
|
+
<link href="{% static 'css/one-page-wonder.min.css' %}" rel="stylesheet">
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<!--My style-->
|
154
|
+
|
155
|
+
<link rel="stylesheet" type="text/css" href="{% static 'css/mystyle.css' %}">
|
156
|
+
|
157
|
+
{% block head %}{% endblock %}
|
158
|
+
|
159
|
+
</head>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<body>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<div id="wrapper">
|
168
|
+
|
169
|
+
<!-- Navigation -->
|
170
|
+
|
171
|
+
<nav class="navbar navbar-expand-lg navbar-dark navbar-custom fixed-top">
|
172
|
+
|
173
|
+
<div class="container">
|
174
|
+
|
175
|
+
<a class="navbar-brand" href="{% url 'diary:index' %}">Squeeze Japanese</a>
|
176
|
+
|
177
|
+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
|
178
|
+
|
179
|
+
<span class="navbar-toggler-icon"></span>
|
180
|
+
|
181
|
+
</button>
|
182
|
+
|
183
|
+
<div class="collapse navbar-collapse" id="navbarResponsive">
|
184
|
+
|
185
|
+
<ul class="navbar-nav mr-auto">
|
186
|
+
|
187
|
+
<li class="nav-item {% block active_inquiry %}{% endblock%}">
|
188
|
+
|
189
|
+
<a class="nav-link" href="{% url 'diary:inquiry' %}">INQUIRY</a>
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
</ul>
|
194
|
+
|
195
|
+
<ul class="navbar-nav ml-auto">
|
196
|
+
|
197
|
+
<li class="nav-item">
|
198
|
+
|
199
|
+
<a class="nav-link" href="#">Sign Up</a>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
<li class="nav-item">
|
204
|
+
|
205
|
+
<a class="nav-link" href="#">Log In</a>
|
206
|
+
|
207
|
+
</li>
|
208
|
+
|
209
|
+
</ul>
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</nav>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
{% block header %}{% endblock %}
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
{% block contents%}{% endblock%}
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<!-- Footer -->
|
228
|
+
|
229
|
+
<footer class="py-5 bg-black">
|
230
|
+
|
231
|
+
<div class="container">
|
232
|
+
|
233
|
+
<p class="m-0 text-center text-white small">Copyright © Private Dairy 2020</p>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<!-- /.container -->
|
238
|
+
|
239
|
+
</footer>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<!-- Bootstrap core JavaScript -->
|
244
|
+
|
245
|
+
<script src="{% static 'vendor/jquery/jquery.min.js' %}"></script>
|
246
|
+
|
247
|
+
<script src="{% static 'vendor/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</body>
|
252
|
+
|
253
|
+
</html>
|
254
|
+
|
255
|
+
```
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
### 追記(Inquiry.html)
|
260
|
+
|
261
|
+
```HTML
|
262
|
+
|
263
|
+
<!DOCTYPE html>
|
264
|
+
|
265
|
+
<html lang="ja">
|
266
|
+
|
267
|
+
<head>
|
268
|
+
|
269
|
+
{% extends 'base.html'%}
|
270
|
+
|
271
|
+
<meta charset="UTF-8">
|
272
|
+
|
273
|
+
{% block title %}Inquiry:Private Diary{% endblock %}
|
274
|
+
|
275
|
+
{% block active_inquiry %} active {% endblock %}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
{% block contents %}
|
280
|
+
|
281
|
+
</head>
|
282
|
+
|
283
|
+
<body>
|
284
|
+
|
285
|
+
<div class="container">
|
286
|
+
|
287
|
+
<div class="row">
|
288
|
+
|
289
|
+
<div class="my-div-style">
|
290
|
+
|
291
|
+
<form method="post">
|
292
|
+
|
293
|
+
{% csrf_token %}
|
294
|
+
|
295
|
+
{{ form.non_field_errors }}
|
296
|
+
|
297
|
+
{% for field in form %}
|
298
|
+
|
299
|
+
<div class="form-group row">
|
300
|
+
|
301
|
+
<label for = "{{ field.id_for_label }}" class ="col-sm-4 col-form-label">
|
302
|
+
|
303
|
+
<strong>{{ field.label_tag }}</strong>
|
304
|
+
|
305
|
+
</label>
|
306
|
+
|
307
|
+
<div class="col-sm-8">
|
308
|
+
|
309
|
+
{{ field }}
|
310
|
+
|
311
|
+
{{ field.errors }}
|
312
|
+
|
313
|
+
</div>
|
314
|
+
|
315
|
+
</div>
|
316
|
+
|
317
|
+
{% endfor %}
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
<div class="offset-sm-4 col-sm-8">
|
322
|
+
|
323
|
+
<buttun class="btn btn-primary" type="submit">submit</buttun>
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
</form>
|
328
|
+
|
329
|
+
</div>
|
330
|
+
|
331
|
+
</div>
|
332
|
+
|
333
|
+
</div>
|
334
|
+
|
335
|
+
{% endblock %}
|
336
|
+
|
337
|
+
</body>
|
338
|
+
|
339
|
+
</html>
|
340
|
+
|
341
|
+
```
|
342
|
+
|
343
|
+
|
344
|
+
|
99
|
-
###
|
345
|
+
### 追記(urls.py)
|
100
346
|
|
101
347
|
```python
|
102
348
|
|
103
|
-
from django.shortcuts import render
|
104
|
-
|
105
|
-
import logging
|
106
|
-
|
107
|
-
from django.urls import
|
349
|
+
from django.urls import path
|
108
|
-
|
109
|
-
|
350
|
+
|
110
|
-
|
111
|
-
from
|
351
|
+
from. import views
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
352
|
+
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
353
|
+
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
354
|
+
|
126
|
-
|
127
|
-
|
355
|
+
app_name = 'diary'
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
356
|
+
|
134
|
-
|
135
|
-
template_name = "inquiry.html"
|
136
|
-
|
137
|
-
|
357
|
+
urlpatterns = [
|
138
|
-
|
358
|
+
|
139
|
-
s
|
359
|
+
path("", views.IndexView.as_view(), name="index"),
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
360
|
+
|
144
|
-
|
145
|
-
form.send_email()
|
146
|
-
|
147
|
-
|
361
|
+
path('inquiry/', views.InquiryView.as_view(), name='inquiry'),
|
148
|
-
|
362
|
+
|
149
|
-
|
363
|
+
]
|
150
364
|
|
151
365
|
```
|
152
366
|
|
153
367
|
|
154
368
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
AL
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
### 追記(エラー分)
|
374
|
+
|
375
|
+
```Error
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
2020-03-22 21:31:45,167 [WARNING] C:\Users\django\utils\log.py(Line:228) Not Found: /favicon.ico
|
382
|
+
|
383
|
+
2020-03-22 21:31:45,167 [WARNING] C:\Users\django\core\servers\basehttp.py(Line:157) GET/favicon.ico HTTP/1.1" 404 2304
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
Traceback (most recent call last):
|
388
|
+
|
389
|
+
handlers.py", line 138, in run
|
390
|
+
|
391
|
+
self.finish_response()
|
392
|
+
|
393
|
+
handlers.py", line 180, in finish_response
|
394
|
+
|
395
|
+
self.write(data)
|
396
|
+
|
397
|
+
handlers.py", line 274, in write
|
398
|
+
|
399
|
+
self.send_headers()
|
400
|
+
|
401
|
+
handlers.py", line 332, in send_headers
|
402
|
+
|
403
|
+
self.send_preamble()
|
404
|
+
|
405
|
+
handlers.py", line 255, in send_preamble
|
406
|
+
|
407
|
+
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
|
408
|
+
|
409
|
+
handlers.py", line 453, in _write
|
410
|
+
|
411
|
+
result = self.stdout.write(data)
|
412
|
+
|
413
|
+
socketserver.py", line 799, in write
|
414
|
+
|
415
|
+
self._sock.sendall(b)
|
416
|
+
|
417
|
+
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
|
418
|
+
|
419
|
+
2020-03-22 21:31:45,167 [ERROR] C:\Users\django\core\servers\basehttp.py(Line:157) "GET /favicon.ico HTTP/1.1" 500 59
|
420
|
+
|
421
|
+
----------------------------------------
|
422
|
+
|
423
|
+
Exception happened during processing of request from ('127.0.0.1', 52275)
|
424
|
+
|
425
|
+
Traceback (most recent call last):
|
426
|
+
|
427
|
+
handlers.py", line 138, in run
|
428
|
+
|
429
|
+
self.finish_response()
|
430
|
+
|
431
|
+
handlers.py", line 180, in finish_response
|
432
|
+
|
433
|
+
self.write(data)
|
434
|
+
|
435
|
+
handlers.py", line 274, in write
|
436
|
+
|
437
|
+
self.send_headers()
|
438
|
+
|
439
|
+
handlers.py", line 332, in send_headers
|
440
|
+
|
441
|
+
self.send_preamble()
|
442
|
+
|
443
|
+
handlers.py", line 255, in send_preamble
|
444
|
+
|
445
|
+
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
|
446
|
+
|
447
|
+
handlers.py", line 453, in _write
|
448
|
+
|
449
|
+
result = self.stdout.write(data)
|
450
|
+
|
451
|
+
socketserver.py", line 799, in write
|
452
|
+
|
453
|
+
self._sock.sendall(b)
|
454
|
+
|
455
|
+
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
During handling of the above exception, another exception occurred:
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
Traceback (most recent call last):
|
464
|
+
|
465
|
+
handlers.py", line 141, in run
|
466
|
+
|
467
|
+
self.handle_error()
|
468
|
+
|
469
|
+
basehttp.py", line 119, in handle_error
|
470
|
+
|
471
|
+
super().handle_error()
|
472
|
+
|
473
|
+
handlers.py", line 368, in handle_error
|
474
|
+
|
475
|
+
self.finish_response()
|
476
|
+
|
477
|
+
handlers.py", line 180, in finish_response
|
478
|
+
|
479
|
+
self.write(data)
|
480
|
+
|
481
|
+
handlers.py", line 274, in write
|
482
|
+
|
483
|
+
self.send_headers()
|
484
|
+
|
485
|
+
handlers.py", line 331, in send_headers
|
486
|
+
|
487
|
+
if not self.origin_server or self.client_is_modern():
|
488
|
+
|
489
|
+
handlers.py", line 344, in client_is_modern
|
490
|
+
|
491
|
+
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
|
492
|
+
|
493
|
+
TypeError: 'NoneType' object is not subscriptable
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
During handling of the above exception, another exception occurred:
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
Traceback (most recent call last):
|
502
|
+
|
503
|
+
socketserver.py", line 650, in process_request_thread
|
504
|
+
|
505
|
+
self.finish_request(request, client_address)
|
506
|
+
|
507
|
+
socketserver.py", line 360, in finish_request
|
508
|
+
|
509
|
+
self.RequestHandlerClass(request, client_address, self)
|
510
|
+
|
511
|
+
socketserver.py", line 720, in __init__
|
512
|
+
|
513
|
+
self.handle()
|
514
|
+
|
515
|
+
basehttp.py", line 174, in handle
|
516
|
+
|
517
|
+
self.handle_one_request()
|
518
|
+
|
519
|
+
basehttp.py", line 197, in handle_one_request
|
520
|
+
|
521
|
+
handler.run(self.server.get_app())
|
522
|
+
|
523
|
+
handlers.py", line 144, in run
|
524
|
+
|
525
|
+
self.close()
|
526
|
+
|
527
|
+
basehttp.py", line 114, in close
|
528
|
+
|
529
|
+
super().close()
|
530
|
+
|
531
|
+
simple_server.py", line 35, in close
|
532
|
+
|
533
|
+
self.status.split(' ',1)[0], self.bytes_sent
|
534
|
+
|
535
|
+
AttributeError: 'NoneType' object has no attribute 'split'
|
246
536
|
|
247
537
|
```
|
248
538
|
|
249
539
|
|
250
540
|
|
251
|
-
### 追記(テンプレートファイル)
|
252
|
-
|
253
|
-
```
|
254
|
-
|
255
|
-
<!DOCTYPE html>
|
256
|
-
|
257
|
-
<html lang="ja">
|
258
|
-
|
259
|
-
<head>
|
260
|
-
|
261
|
-
{% extends 'base.html'%}
|
262
|
-
|
263
|
-
<meta charset="UTF-8">
|
264
|
-
|
265
|
-
{% block title %}Inquiry:Private Diary{% endblock %}
|
266
|
-
|
267
|
-
{% block active_inquiry %} active {% endblock %}
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
{% block contents %}
|
272
|
-
|
273
|
-
</head>
|
274
|
-
|
275
|
-
<body>
|
276
|
-
|
277
|
-
<div class="container">
|
278
|
-
|
279
|
-
<div class="row">
|
280
|
-
|
281
|
-
<div class="my-div-style">
|
282
|
-
|
283
|
-
<form method="post">
|
284
|
-
|
285
|
-
{% csrf_token %}
|
286
|
-
|
287
|
-
{{ form.non_field_errors }}
|
288
|
-
|
289
|
-
{% for field in form %}
|
290
|
-
|
291
|
-
<div class="form-group row">
|
292
|
-
|
293
|
-
<label for = "{{ field.id_for_label }}" class ="col-sm-4 col-form-label">
|
294
|
-
|
295
|
-
<strong>{{ field.label_tag }}</strong>
|
296
|
-
|
297
|
-
</label>
|
298
|
-
|
299
|
-
<div class="col-sm-8">
|
300
|
-
|
301
|
-
{{ field }}
|
302
|
-
|
303
|
-
{{ field.errors }}
|
304
|
-
|
305
|
-
</div>
|
306
|
-
|
307
|
-
</div>
|
308
|
-
|
309
|
-
{% endfor %}
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
<div class="offset-sm-4 col-sm-8">
|
314
|
-
|
315
|
-
<buttun class="btn btn-primary" type="submit">submit</buttun>
|
316
|
-
|
317
|
-
</div>
|
318
|
-
|
319
|
-
</form>
|
320
|
-
|
321
|
-
</div>
|
322
|
-
|
323
|
-
</div>
|
324
|
-
|
325
|
-
</div>
|
326
|
-
|
327
|
-
{% endblock %}
|
328
|
-
|
329
|
-
</body>
|
330
|
-
|
331
|
-
</html>
|
332
|
-
|
333
|
-
```
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
### 追記(urls.py)
|
338
|
-
|
339
|
-
```python
|
340
|
-
|
341
|
-
from django.urls import path
|
342
|
-
|
343
|
-
from. import views
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
app_name = 'diary'
|
348
|
-
|
349
|
-
urlpatterns = [
|
350
|
-
|
351
|
-
path("", views.IndexView.as_view(), name="index"),
|
352
|
-
|
353
|
-
path('inquiry/', views.InquiryView.as_view(), name='inquiry'),
|
354
|
-
|
355
|
-
]
|
356
|
-
|
357
|
-
```
|
358
|
-
|
359
|
-
|
360
|
-
|
361
541
|
### 追記(最終画像)
|
362
542
|
|
363
543
|
![イメージ説明](b0df9c151084a22f667a3f0cf4df89f2.jpeg)
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
### 追記(エラー分)
|
368
|
-
|
369
|
-
```Error
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
2020-03-22 21:31:45,167 [WARNING] C:\Users\django\utils\log.py(Line:228) Not Found: /favicon.ico
|
376
|
-
|
377
|
-
2020-03-22 21:31:45,167 [WARNING] C:\Users\django\core\servers\basehttp.py(Line:157) GET/favicon.ico HTTP/1.1" 404 2304
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
Traceback (most recent call last):
|
382
|
-
|
383
|
-
handlers.py", line 138, in run
|
384
|
-
|
385
|
-
self.finish_response()
|
386
|
-
|
387
|
-
handlers.py", line 180, in finish_response
|
388
|
-
|
389
|
-
self.write(data)
|
390
|
-
|
391
|
-
handlers.py", line 274, in write
|
392
|
-
|
393
|
-
self.send_headers()
|
394
|
-
|
395
|
-
handlers.py", line 332, in send_headers
|
396
|
-
|
397
|
-
self.send_preamble()
|
398
|
-
|
399
|
-
handlers.py", line 255, in send_preamble
|
400
|
-
|
401
|
-
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
|
402
|
-
|
403
|
-
handlers.py", line 453, in _write
|
404
|
-
|
405
|
-
result = self.stdout.write(data)
|
406
|
-
|
407
|
-
socketserver.py", line 799, in write
|
408
|
-
|
409
|
-
self._sock.sendall(b)
|
410
|
-
|
411
|
-
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
|
412
|
-
|
413
|
-
2020-03-22 21:31:45,167 [ERROR] C:\Users\django\core\servers\basehttp.py(Line:157) "GET /favicon.ico HTTP/1.1" 500 59
|
414
|
-
|
415
|
-
----------------------------------------
|
416
|
-
|
417
|
-
Exception happened during processing of request from ('127.0.0.1', 52275)
|
418
|
-
|
419
|
-
Traceback (most recent call last):
|
420
|
-
|
421
|
-
handlers.py", line 138, in run
|
422
|
-
|
423
|
-
self.finish_response()
|
424
|
-
|
425
|
-
handlers.py", line 180, in finish_response
|
426
|
-
|
427
|
-
self.write(data)
|
428
|
-
|
429
|
-
handlers.py", line 274, in write
|
430
|
-
|
431
|
-
self.send_headers()
|
432
|
-
|
433
|
-
handlers.py", line 332, in send_headers
|
434
|
-
|
435
|
-
self.send_preamble()
|
436
|
-
|
437
|
-
handlers.py", line 255, in send_preamble
|
438
|
-
|
439
|
-
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
|
440
|
-
|
441
|
-
handlers.py", line 453, in _write
|
442
|
-
|
443
|
-
result = self.stdout.write(data)
|
444
|
-
|
445
|
-
socketserver.py", line 799, in write
|
446
|
-
|
447
|
-
self._sock.sendall(b)
|
448
|
-
|
449
|
-
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
During handling of the above exception, another exception occurred:
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
Traceback (most recent call last):
|
458
|
-
|
459
|
-
handlers.py", line 141, in run
|
460
|
-
|
461
|
-
self.handle_error()
|
462
|
-
|
463
|
-
basehttp.py", line 119, in handle_error
|
464
|
-
|
465
|
-
super().handle_error()
|
466
|
-
|
467
|
-
handlers.py", line 368, in handle_error
|
468
|
-
|
469
|
-
self.finish_response()
|
470
|
-
|
471
|
-
handlers.py", line 180, in finish_response
|
472
|
-
|
473
|
-
self.write(data)
|
474
|
-
|
475
|
-
handlers.py", line 274, in write
|
476
|
-
|
477
|
-
self.send_headers()
|
478
|
-
|
479
|
-
handlers.py", line 331, in send_headers
|
480
|
-
|
481
|
-
if not self.origin_server or self.client_is_modern():
|
482
|
-
|
483
|
-
handlers.py", line 344, in client_is_modern
|
484
|
-
|
485
|
-
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
|
486
|
-
|
487
|
-
TypeError: 'NoneType' object is not subscriptable
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
During handling of the above exception, another exception occurred:
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
Traceback (most recent call last):
|
496
|
-
|
497
|
-
socketserver.py", line 650, in process_request_thread
|
498
|
-
|
499
|
-
self.finish_request(request, client_address)
|
500
|
-
|
501
|
-
socketserver.py", line 360, in finish_request
|
502
|
-
|
503
|
-
self.RequestHandlerClass(request, client_address, self)
|
504
|
-
|
505
|
-
socketserver.py", line 720, in __init__
|
506
|
-
|
507
|
-
self.handle()
|
508
|
-
|
509
|
-
basehttp.py", line 174, in handle
|
510
|
-
|
511
|
-
self.handle_one_request()
|
512
|
-
|
513
|
-
basehttp.py", line 197, in handle_one_request
|
514
|
-
|
515
|
-
handler.run(self.server.get_app())
|
516
|
-
|
517
|
-
handlers.py", line 144, in run
|
518
|
-
|
519
|
-
self.close()
|
520
|
-
|
521
|
-
basehttp.py", line 114, in close
|
522
|
-
|
523
|
-
super().close()
|
524
|
-
|
525
|
-
simple_server.py", line 35, in close
|
526
|
-
|
527
|
-
self.status.split(' ',1)[0], self.bytes_sent
|
528
|
-
|
529
|
-
AttributeError: 'NoneType' object has no attribute 'split'
|
530
|
-
|
531
|
-
```
|
3
追記ーエラー文
test
CHANGED
File without changes
|
test
CHANGED
@@ -361,3 +361,171 @@
|
|
361
361
|
### 追記(最終画像)
|
362
362
|
|
363
363
|
![イメージ説明](b0df9c151084a22f667a3f0cf4df89f2.jpeg)
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
### 追記(エラー分)
|
368
|
+
|
369
|
+
```Error
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
2020-03-22 21:31:45,167 [WARNING] C:\Users\django\utils\log.py(Line:228) Not Found: /favicon.ico
|
376
|
+
|
377
|
+
2020-03-22 21:31:45,167 [WARNING] C:\Users\django\core\servers\basehttp.py(Line:157) GET/favicon.ico HTTP/1.1" 404 2304
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
Traceback (most recent call last):
|
382
|
+
|
383
|
+
handlers.py", line 138, in run
|
384
|
+
|
385
|
+
self.finish_response()
|
386
|
+
|
387
|
+
handlers.py", line 180, in finish_response
|
388
|
+
|
389
|
+
self.write(data)
|
390
|
+
|
391
|
+
handlers.py", line 274, in write
|
392
|
+
|
393
|
+
self.send_headers()
|
394
|
+
|
395
|
+
handlers.py", line 332, in send_headers
|
396
|
+
|
397
|
+
self.send_preamble()
|
398
|
+
|
399
|
+
handlers.py", line 255, in send_preamble
|
400
|
+
|
401
|
+
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
|
402
|
+
|
403
|
+
handlers.py", line 453, in _write
|
404
|
+
|
405
|
+
result = self.stdout.write(data)
|
406
|
+
|
407
|
+
socketserver.py", line 799, in write
|
408
|
+
|
409
|
+
self._sock.sendall(b)
|
410
|
+
|
411
|
+
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
|
412
|
+
|
413
|
+
2020-03-22 21:31:45,167 [ERROR] C:\Users\django\core\servers\basehttp.py(Line:157) "GET /favicon.ico HTTP/1.1" 500 59
|
414
|
+
|
415
|
+
----------------------------------------
|
416
|
+
|
417
|
+
Exception happened during processing of request from ('127.0.0.1', 52275)
|
418
|
+
|
419
|
+
Traceback (most recent call last):
|
420
|
+
|
421
|
+
handlers.py", line 138, in run
|
422
|
+
|
423
|
+
self.finish_response()
|
424
|
+
|
425
|
+
handlers.py", line 180, in finish_response
|
426
|
+
|
427
|
+
self.write(data)
|
428
|
+
|
429
|
+
handlers.py", line 274, in write
|
430
|
+
|
431
|
+
self.send_headers()
|
432
|
+
|
433
|
+
handlers.py", line 332, in send_headers
|
434
|
+
|
435
|
+
self.send_preamble()
|
436
|
+
|
437
|
+
handlers.py", line 255, in send_preamble
|
438
|
+
|
439
|
+
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
|
440
|
+
|
441
|
+
handlers.py", line 453, in _write
|
442
|
+
|
443
|
+
result = self.stdout.write(data)
|
444
|
+
|
445
|
+
socketserver.py", line 799, in write
|
446
|
+
|
447
|
+
self._sock.sendall(b)
|
448
|
+
|
449
|
+
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
During handling of the above exception, another exception occurred:
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
Traceback (most recent call last):
|
458
|
+
|
459
|
+
handlers.py", line 141, in run
|
460
|
+
|
461
|
+
self.handle_error()
|
462
|
+
|
463
|
+
basehttp.py", line 119, in handle_error
|
464
|
+
|
465
|
+
super().handle_error()
|
466
|
+
|
467
|
+
handlers.py", line 368, in handle_error
|
468
|
+
|
469
|
+
self.finish_response()
|
470
|
+
|
471
|
+
handlers.py", line 180, in finish_response
|
472
|
+
|
473
|
+
self.write(data)
|
474
|
+
|
475
|
+
handlers.py", line 274, in write
|
476
|
+
|
477
|
+
self.send_headers()
|
478
|
+
|
479
|
+
handlers.py", line 331, in send_headers
|
480
|
+
|
481
|
+
if not self.origin_server or self.client_is_modern():
|
482
|
+
|
483
|
+
handlers.py", line 344, in client_is_modern
|
484
|
+
|
485
|
+
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
|
486
|
+
|
487
|
+
TypeError: 'NoneType' object is not subscriptable
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
During handling of the above exception, another exception occurred:
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
Traceback (most recent call last):
|
496
|
+
|
497
|
+
socketserver.py", line 650, in process_request_thread
|
498
|
+
|
499
|
+
self.finish_request(request, client_address)
|
500
|
+
|
501
|
+
socketserver.py", line 360, in finish_request
|
502
|
+
|
503
|
+
self.RequestHandlerClass(request, client_address, self)
|
504
|
+
|
505
|
+
socketserver.py", line 720, in __init__
|
506
|
+
|
507
|
+
self.handle()
|
508
|
+
|
509
|
+
basehttp.py", line 174, in handle
|
510
|
+
|
511
|
+
self.handle_one_request()
|
512
|
+
|
513
|
+
basehttp.py", line 197, in handle_one_request
|
514
|
+
|
515
|
+
handler.run(self.server.get_app())
|
516
|
+
|
517
|
+
handlers.py", line 144, in run
|
518
|
+
|
519
|
+
self.close()
|
520
|
+
|
521
|
+
basehttp.py", line 114, in close
|
522
|
+
|
523
|
+
super().close()
|
524
|
+
|
525
|
+
simple_server.py", line 35, in close
|
526
|
+
|
527
|
+
self.status.split(' ',1)[0], self.bytes_sent
|
528
|
+
|
529
|
+
AttributeError: 'NoneType' object has no attribute 'split'
|
530
|
+
|
531
|
+
```
|
2
追記ー画像
test
CHANGED
File without changes
|
test
CHANGED
@@ -355,3 +355,9 @@
|
|
355
355
|
]
|
356
356
|
|
357
357
|
```
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
### 追記(最終画像)
|
362
|
+
|
363
|
+
![イメージ説明](b0df9c151084a22f667a3f0cf4df89f2.jpeg)
|
1
コードの追記です。
test
CHANGED
File without changes
|
test
CHANGED
@@ -245,3 +245,113 @@
|
|
245
245
|
|
246
246
|
|
247
247
|
```
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
### 追記(テンプレートファイル)
|
252
|
+
|
253
|
+
```
|
254
|
+
|
255
|
+
<!DOCTYPE html>
|
256
|
+
|
257
|
+
<html lang="ja">
|
258
|
+
|
259
|
+
<head>
|
260
|
+
|
261
|
+
{% extends 'base.html'%}
|
262
|
+
|
263
|
+
<meta charset="UTF-8">
|
264
|
+
|
265
|
+
{% block title %}Inquiry:Private Diary{% endblock %}
|
266
|
+
|
267
|
+
{% block active_inquiry %} active {% endblock %}
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
{% block contents %}
|
272
|
+
|
273
|
+
</head>
|
274
|
+
|
275
|
+
<body>
|
276
|
+
|
277
|
+
<div class="container">
|
278
|
+
|
279
|
+
<div class="row">
|
280
|
+
|
281
|
+
<div class="my-div-style">
|
282
|
+
|
283
|
+
<form method="post">
|
284
|
+
|
285
|
+
{% csrf_token %}
|
286
|
+
|
287
|
+
{{ form.non_field_errors }}
|
288
|
+
|
289
|
+
{% for field in form %}
|
290
|
+
|
291
|
+
<div class="form-group row">
|
292
|
+
|
293
|
+
<label for = "{{ field.id_for_label }}" class ="col-sm-4 col-form-label">
|
294
|
+
|
295
|
+
<strong>{{ field.label_tag }}</strong>
|
296
|
+
|
297
|
+
</label>
|
298
|
+
|
299
|
+
<div class="col-sm-8">
|
300
|
+
|
301
|
+
{{ field }}
|
302
|
+
|
303
|
+
{{ field.errors }}
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
</div>
|
308
|
+
|
309
|
+
{% endfor %}
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
<div class="offset-sm-4 col-sm-8">
|
314
|
+
|
315
|
+
<buttun class="btn btn-primary" type="submit">submit</buttun>
|
316
|
+
|
317
|
+
</div>
|
318
|
+
|
319
|
+
</form>
|
320
|
+
|
321
|
+
</div>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
{% endblock %}
|
328
|
+
|
329
|
+
</body>
|
330
|
+
|
331
|
+
</html>
|
332
|
+
|
333
|
+
```
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
### 追記(urls.py)
|
338
|
+
|
339
|
+
```python
|
340
|
+
|
341
|
+
from django.urls import path
|
342
|
+
|
343
|
+
from. import views
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
app_name = 'diary'
|
348
|
+
|
349
|
+
urlpatterns = [
|
350
|
+
|
351
|
+
path("", views.IndexView.as_view(), name="index"),
|
352
|
+
|
353
|
+
path('inquiry/', views.InquiryView.as_view(), name='inquiry'),
|
354
|
+
|
355
|
+
]
|
356
|
+
|
357
|
+
```
|