Open LSY310 opened 4 months ago
db접속해서 확인결과
Schema | Name | Type | Owner
--------+-------------------------------+-------+-----------
public | account_emailaddress | table | han_cycle
public | account_emailconfirmation | table | han_cycle
public | auth_group | table | han_cycle
public | auth_group_permissions | table | han_cycle
public | auth_permission | table | han_cycle
public | auth_user | table | han_cycle
public | auth_user_groups | table | han_cycle
public | auth_user_user_permissions | table | han_cycle
public | authtoken_token | table | han_cycle
public | boards_comment | table | han_cycle
public | boards_image | table | han_cycle
public | boards_picture | table | han_cycle
public | boards_post | table | han_cycle
public | boards_post_thumbnail | table | han_cycle
public | django_admin_log | table | han_cycle
public | django_content_type | table | han_cycle
public | django_migrations | table | han_cycle
public | django_session | table | han_cycle
user_profile 미완성으로 table이 없음
users_users 테이블이 있길래 model을 profile에서 users로 수정해서 실행해보니
Traceback (most recent call last):
File "
users.users.user_id 를 찾지 못해 생긴 오류 users모델에서 user가 의미하는게 auth관련한 user인거 같은데,,, 흠냐링,,,
음.. 사견으로는
erd랑 다르게 되어있어서 그런것도 있구 보니까 모델부분에서 user을 인증부분때문에 auth user모델 끌고와서 만든거같더라궁,, 근데 그쪽에 데이터가 뭐가 제대로 안들어가있어서,,?아니면 우리 db에 이 부분이 반영이 안되어있어서..? 이런 오류가 생긴게 아닐까 추측해봅니당,..
유저모델 erd와 일치 시키는 작업 수행
app-1 | The above exception was the direct cause of the following exception: app-1 | app-1 | Traceback (most recent call last): app-1 | File "/py/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner app-1 | response = get_response(request) app-1 | ^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response app-1 | response = wrapped_callback(request, *callback_args, callback_kwargs) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view app-1 | return view_func(*args, *kwargs) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view app-1 | return self.dispatch(request, args, kwargs) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch app-1 | response = self.handle_exception(exc) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception app-1 | self.raise_uncaught_exception(exc) app-1 | File "/py/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception app-1 | raise exc app-1 | File "/py/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch app-1 | response = handler(request, *args, *kwargs) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/decorators.py", line 50, in handler app-1 | return func(args, **kwargs) app-1 | ^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/app/boards/views.py", line 31, in posts app-1 | if serializer.is_valid(raise_exception=True): app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/serializers.py", line 223, in is_valid app-1 | self._validated_data = self.run_validation(self.initial_data) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/serializers.py", line 442, in run_validation app-1 | value = self.to_internal_value(data) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/serializers.py", line 499, in to_internal_value app-1 | validated_value = field.run_validation(primitive_value) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/relations.py", line 155, in run_validation app-1 | return super().run_validation(data) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/fields.py", line 538, in run_validation app-1 | value = self.to_internal_value(data) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/rest_framework/relations.py", line 259, in to_internal_value app-1 | return queryset.get(pk=data) app-1 | ^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/db/models/query.py", line 633, in get app-1 | num = len(clone) app-1 | ^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/db/models/query.py", line 380, in len app-1 | self._fetch_all() app-1 | File "/py/lib/python3.11/site-packages/django/db/models/query.py", line 1881, in _fetch_all app-1 | self._result_cache = list(self._iterable_class(self)) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/db/models/query.py", line 91, in iter app-1 | results = compiler.execute_sql( app-1 | ^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql app-1 | cursor.execute(sql, params) app-1 | File "/py/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute app-1 | return super().execute(sql, params) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute app-1 | return self._execute_with_wrappers( app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers app-1 | return executor(sql, params, many, context) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | File "/py/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute app-1 | with self.db.wrap_database_errors: app-1 | File "/py/lib/python3.11/site-packages/django/db/utils.py", line 91, in exit app-1 | raise dj_exc_value.with_traceback(traceback) from exc_value app-1 | File "/py/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute app-1 | return self.cursor.execute(sql, params) app-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ app-1 | django.db.utils.ProgrammingError: relation "users_profile" does not exist app-1 | LINE 1: ...le"."password", "users_profile"."created_at" FROM "users_pro...
난... posts에서 users_profile을 사용하는 부분이 없는데... 도대체 어디서 오류가 계속 나는것인가...