backend 2

django error (fields.E304) Reverse accessor "Group.user_set" for ~ clashes with reverse accessor for "auth.User.groups". (User 클래스)

문제상황 예제를 따라 만들면서 migrate를 시도했는데, User가 충돌한다는 에러가 나왔다. 예제는 User class를 새로 정의하고, 그 User를 기반으로 django 테이블에 저장할 회원을 관리하는 예제였다. (fields.E304) Reverse accessor 'Group.user_set' for 'accounts.UserModel.groups' clashes with reverse accessor for 'auth.User.groups'. 해결책 settings.py에 django auth를 사용하는 User class를 위 사진처럼 설정해주면 된다. accounts는 User class가 있는 django app(폴더) 이름이다. 검색하자마자 나와서 빠르게 고칠 수 있었다. 참고한 자료..

IT/Development 2023.05.20

django error importing module(WSGI application could not be loaded;) 해결(dependency 체크)

문제 상황 git clone 후 예제를 실행해보려고 python manage.py runserver를 쳤는데, 에러가 나면서 실행이 되지 않았다. 환경변수도 분명 맞게 설정해준 것 같았는데.. django.core.exceptions.ImproperlyConfigured: WSGI application 'backend.wsgi.application' could not be loaded; Error importing module. 해결 여러 블로그를 보다가, whitenoise라는 모듈의 설치가 이슈가 된 케이스를 몇 번 봤다. 그러고보니 wsgi 환경설정을 내 로컬로 해둔 적은 없고, 지난번엔 poetry로 dependency 관리를 하는 프로젝트여서 문제를 못 겪은 것인가 싶었다. 그래서 해결책으로 "..

IT/Development 2023.05.17