質問編集履歴

1

情報の追記

2019/04/03 02:04

投稿

削除済ユーザー
test CHANGED
File without changes
test CHANGED
@@ -65,283 +65,3 @@
65
65
  助けていただけると嬉しいです。
66
66
 
67
67
  よろしくお願いします。
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
- ーーーーー追記ーーーーーー
76
-
77
- エラーコードとurls.pyを追記します。アプリ名の部分は変更記述しています。
78
-
79
- また、自身の中でOneToOneFieldに原因があるように思えてしまっていて、モデル同士の紐付けができていないのかなと考えています。
80
-
81
- [この記事](https://narito.ninja/blog/detail/47/)にあるように何か記述が必要なのでしょうか?今回はソーシャル認証なのでどう参考になるかも曖昧なのですが…。
82
-
83
- ```
84
-
85
- Environment:
86
-
87
-
88
-
89
- Request Method: POST
90
-
91
- Request URL: http://127.0.0.1:8000/create/
92
-
93
-
94
-
95
- Django Version: 2.1.7
96
-
97
- Python Version: 3.7.0
98
-
99
- Installed Applications:
100
-
101
- ['django.contrib.admin',
102
-
103
- 'django.contrib.auth',
104
-
105
- 'django.contrib.contenttypes',
106
-
107
- 'django.contrib.sessions',
108
-
109
- 'django.contrib.messages',
110
-
111
- 'django.contrib.staticfiles',
112
-
113
- 'App.apps.AppConfig',
114
-
115
- 'social_django']
116
-
117
- Installed Middleware:
118
-
119
- ['django.middleware.security.SecurityMiddleware',
120
-
121
- 'django.contrib.sessions.middleware.SessionMiddleware',
122
-
123
- 'django.middleware.common.CommonMiddleware',
124
-
125
- 'django.middleware.csrf.CsrfViewMiddleware',
126
-
127
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
128
-
129
- 'django.contrib.messages.middleware.MessageMiddleware',
130
-
131
- 'django.middleware.clickjacking.XFrameOptionsMiddleware']
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
- Traceback:
140
-
141
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute
142
-
143
- 85. return self.cursor.execute(sql, params)
144
-
145
-
146
-
147
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py" in execute
148
-
149
- 298. return Database.Cursor.execute(self, query, params)
150
-
151
-
152
-
153
- The above exception (no such column: user_id) was the direct cause of the following exception:
154
-
155
-
156
-
157
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
158
-
159
- 34. response = get_response(request)
160
-
161
-
162
-
163
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
164
-
165
- 126. response = self.process_exception_by_middleware(e, request)
166
-
167
-
168
-
169
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
170
-
171
- 124. response = wrapped_callback(request, *callback_args, **callback_kwargs)
172
-
173
-
174
-
175
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/views/generic/base.py" in view
176
-
177
- 68. return self.dispatch(request, *args, **kwargs)
178
-
179
-
180
-
181
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/contrib/auth/mixins.py" in dispatch
182
-
183
- 52. return super().dispatch(request, *args, **kwargs)
184
-
185
-
186
-
187
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/views/generic/base.py" in dispatch
188
-
189
- 88. return handler(request, *args, **kwargs)
190
-
191
-
192
-
193
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/views/generic/edit.py" in post
194
-
195
- 172. return super().post(request, *args, **kwargs)
196
-
197
-
198
-
199
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/views/generic/edit.py" in post
200
-
201
- 142. return self.form_valid(form)
202
-
203
-
204
-
205
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/views/generic/edit.py" in form_valid
206
-
207
- 125. self.object = form.save()
208
-
209
-
210
-
211
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/forms/models.py" in save
212
-
213
- 458. self.instance.save()
214
-
215
-
216
-
217
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/models/base.py" in save
218
-
219
- 718. force_update=force_update, update_fields=update_fields)
220
-
221
-
222
-
223
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/models/base.py" in save_base
224
-
225
- 748. updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
226
-
227
-
228
-
229
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/models/base.py" in _save_table
230
-
231
- 812. forced_update)
232
-
233
-
234
-
235
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/models/base.py" in _do_update
236
-
237
- 861. return filtered._update(values) > 0
238
-
239
-
240
-
241
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/models/query.py" in _update
242
-
243
- 712. return query.get_compiler(self.db).execute_sql(CURSOR)
244
-
245
-
246
-
247
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
248
-
249
- 1383. cursor = super().execute_sql(result_type)
250
-
251
-
252
-
253
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
254
-
255
- 1065. cursor.execute(sql, params)
256
-
257
-
258
-
259
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/utils.py" in execute
260
-
261
- 100. return super().execute(sql, params)
262
-
263
-
264
-
265
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/utils.py" in execute
266
-
267
- 68. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
268
-
269
-
270
-
271
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute_with_wrappers
272
-
273
- 77. return executor(sql, params, many, context)
274
-
275
-
276
-
277
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute
278
-
279
- 85. return self.cursor.execute(sql, params)
280
-
281
-
282
-
283
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/utils.py" in __exit__
284
-
285
- 89. raise dj_exc_value.with_traceback(traceback) from exc_value
286
-
287
-
288
-
289
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/utils.py" in _execute
290
-
291
- 85. return self.cursor.execute(sql, params)
292
-
293
-
294
-
295
- File "/Users/username/PycharmProjects/project/venv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py" in execute
296
-
297
- 298. return Database.Cursor.execute(self, query, params)
298
-
299
-
300
-
301
- Exception Type: OperationalError at /create/
302
-
303
- Exception Value: no such column: user_id
304
-
305
- ```
306
-
307
- 以下にurls.py
308
-
309
- ```
310
-
311
- from django.contrib import admin
312
-
313
- from django.conf import settings
314
-
315
- from django.conf.urls.static import static
316
-
317
- from django.urls import include, path
318
-
319
- from memo.views import IndexView, MemoDetailView, MemoCreateView, MemoUpdateView, MemoDeleteView
320
-
321
-
322
-
323
-
324
-
325
- urlpatterns = [
326
-
327
- path('', IndexView.as_view(), name="index"),
328
-
329
- path('<uuid:pk>', MemoDetailView.as_view(), name="detail"),
330
-
331
- path('<uuid:pk>/update', MemoUpdateView.as_view(), name="update"),
332
-
333
- path('<uuid:pk>/delete', MemoDeleteView.as_view(), name="delete"),
334
-
335
-
336
-
337
- path('create/', MemoCreateView.as_view(), name="create"),
338
-
339
- path('admin/', admin.site.urls),
340
-
341
- path('', include('social_django.urls', namespace='social'))
342
-
343
- ]
344
-
345
- urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
346
-
347
- ```