반응형
django.urls.exceptions.NoReverseMatch: Reverse for 'account_inactive' not found. 'account_inactive' is not a valid view function or pattern name.
아래 사진은 소셜로그인으로 로그인시 유저 이메일 정보를 받고 유저가 존재하지않으면 회원가입을 시켜주는 부분인데 이부분에서 위 제목처럼 에러가 발생하였다.
발생원인
현재는 is_active의 기본 값이 True로 되어 있지만 에러가 났을 당시에는 False로 되어있어 user 생성시 계정이 비활성화되어 있어서 그랬던 것이다.
해결 방법
1. user 모델의 is_active의 기본값을 True로 변경한다.
2. 마이그레이션 파일을 만든후 적용시켜준다.
3. 기존의 user 객체들의 is_active가 False로 되어있는 부분을 True로 바꾸어 주었다.
django.urls.exceptions.NoReverseMatch: Reverse for 'account_inactive' not found. 'account_inactive' is not a valid view function
I am using django-rest-auth registration api, I overridden that by using my own SERIALIZER and model. So I am getting error. I have tried by setting active at the time user created. But that is not
stackoverflow.com
반응형
'Django > DRF' 카테고리의 다른 글
[Authentication] DRF Authentication, Permission (인증, 권한) (0) | 2024.03.20 |
---|---|
[View] DRF CBV 뷰의 종류와 차이점 (APIView, Mixins, Generic APIView, ViewSet) (2) | 2024.03.19 |
Django 프로젝트 단계별 가이드라인 3 (0) | 2023.12.03 |
Django allauth django_site relation does not exist error (0) | 2023.12.02 |
Django 프로젝트 단계별 가이드라인 2 (0) | 2023.12.01 |