質問編集履歴
1
情報追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,8 +6,16 @@
|
|
6
6
|
### 発生している問題・エラーメッセージ
|
7
7
|
|
8
8
|
```
|
9
|
+
[29/Sep/2020 10:19:30] "GET /accounts/create/ HTTP/1.1" 200 621
|
9
|
-
|
10
|
+
Internal Server Error: /accounts/create/
|
11
|
+
Traceback (most recent call last):
|
12
|
+
File "C:\Users\takara\miniconda3\envs\ex2020\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
|
13
|
+
response = get_response(request)
|
14
|
+
File "C:\Users\takara\miniconda3\envs\ex2020\lib\site-packages\django\utils\deprecation.py", line 96, in __call__
|
15
|
+
response = self.process_response(request, response)
|
16
|
+
File "C:\Users\takara\miniconda3\envs\ex2020\lib\site-packages\django\middleware\clickjacking.py", line 26, in process_response
|
17
|
+
if response.get('X-Frame-Options') is not None:
|
10
|
-
'tuple' object has no attribute 'get'
|
18
|
+
AttributeError: 'tuple' object has no attribute 'get'
|
11
19
|
|
12
20
|
```
|
13
21
|
### 該当のソースコード
|
@@ -49,7 +57,111 @@
|
|
49
57
|
|
50
58
|
|
51
59
|
```
|
60
|
+
```html
|
61
|
+
---home.html---
|
62
|
+
{% extends 'base.html' %}
|
52
63
|
|
64
|
+
{% block title %}Home{% endblock %}
|
65
|
+
|
66
|
+
{% block content %}
|
67
|
+
{% if user.is_authenticated %}
|
68
|
+
Hi {{ user.username }}!
|
69
|
+
<a href="accounts/create">ランキング参加用URL発行はこちら</a>
|
70
|
+
{{title}}{{number}}
|
71
|
+
{% else %}
|
72
|
+
<p>You are not logged in</p>
|
73
|
+
<a href="{% url 'login' %}">Log In</a>
|
74
|
+
{% endif %}
|
75
|
+
{% endblock %}
|
76
|
+
|
77
|
+
---create.html---
|
78
|
+
{% extends 'base.html' %}
|
79
|
+
|
80
|
+
{% block title %}Home{% endblock %}
|
81
|
+
|
82
|
+
{% block content %}
|
83
|
+
{% if user.is_authenticated %}
|
84
|
+
Hi {{ user.username }}!
|
85
|
+
<h1>{{title}}</h1>
|
86
|
+
<table>
|
87
|
+
<form action="{% url 'create' %}" method="post">
|
88
|
+
{% csrf_token %}
|
89
|
+
{{ form.as_table }}
|
90
|
+
<tr><td></td><td><input type="submit" value ="click"></td></tr>
|
91
|
+
</form>
|
92
|
+
</table>
|
93
|
+
{% else %}
|
94
|
+
<p>You are not logged in</p>
|
95
|
+
<a href="{% url 'login' %}">Log In</a>
|
96
|
+
{% endif %}
|
97
|
+
{% endblock %}
|
98
|
+
|
53
|
-
|
99
|
+
```
|
100
|
+
|
101
|
+
### ディレクトリ
|
102
|
+
|
103
|
+
|
104
|
+
│ db.sqlite3
|
105
|
+
│ manage.py
|
106
|
+
│
|
107
|
+
├─accounts
|
108
|
+
│ │ admin.py
|
109
|
+
│ │ apps.py
|
110
|
+
│ │ forms.py
|
111
|
+
│ │ models.py
|
112
|
+
│ │ tests.py
|
113
|
+
│ │ urls.py
|
114
|
+
│ │ views.py
|
115
|
+
│ │ __init__.py
|
116
|
+
│ │
|
117
|
+
│ ├─migrations
|
118
|
+
│ │ │ 0001_initial.py
|
119
|
+
│ │ │ 0002_remove_channel_money.py
|
120
|
+
│ │ │ 0003_channel_rink_id.py
|
121
|
+
│ │ │ 0004_auto_20200928_1642.py
|
122
|
+
│ │ │ 0005_auto_20200928_1934.py
|
123
|
+
│ │ │ 0006_auto_20200928_1943.py
|
124
|
+
│ │ │ __init__.py
|
125
|
+
│ │ │
|
126
|
+
│ │ └─__pycache__
|
127
|
+
│ │ 0001_initial.cpython-38.pyc
|
128
|
+
│ │ 0002_remove_channel_money.cpython-38.pyc
|
129
|
+
│ │ 0003_channel_rink_id.cpython-38.pyc
|
130
|
+
│ │ 0004_auto_20200928_1642.cpython-38.pyc
|
131
|
+
│ │ 0005_auto_20200928_1934.cpython-38.pyc
|
132
|
+
│ │ 0006_auto_20200928_1943.cpython-38.pyc
|
133
|
+
│ │ __init__.cpython-38.pyc
|
134
|
+
│ │
|
135
|
+
│ └─__pycache__
|
136
|
+
│ admin.cpython-38.pyc
|
137
|
+
│ forms.cpython-38.pyc
|
138
|
+
│ models.cpython-38.pyc
|
139
|
+
│ urls.cpython-38.pyc
|
140
|
+
│ views.cpython-38.pyc
|
141
|
+
│ __init__.cpython-38.pyc
|
142
|
+
│
|
143
|
+
├─config
|
144
|
+
│ │ asgi.py
|
145
|
+
│ │ settings.py
|
146
|
+
│ │ urls.py
|
147
|
+
│ │ wsgi.py
|
148
|
+
│ │ __init__.py
|
149
|
+
│ │
|
150
|
+
│ └─__pycache__
|
151
|
+
│ settings.cpython-38.pyc
|
152
|
+
│ urls.cpython-38.pyc
|
153
|
+
│ wsgi.cpython-38.pyc
|
154
|
+
│ __init__.cpython-38.pyc
|
155
|
+
│
|
54
|
-
|
156
|
+
└─templates
|
157
|
+
│ base.html
|
158
|
+
│ home.html
|
159
|
+
│
|
160
|
+
├─accounts
|
161
|
+
│ create.html
|
162
|
+
│
|
163
|
+
└─registration
|
164
|
+
login.html
|
55
|
-
|
165
|
+
signup.html
|
166
|
+
|
167
|
+
```
|