Django/DRF

django.urls.exceptions.NoReverseMatch: Reverse for 'account_inactive' not found. 'account_inactive' is not a valid view function or pattern name.

Jong_seoung 2023. 12. 4. 13:18
반응형

django.urls.exceptions.NoReverseMatch: Reverse for 'account_inactive' not found. 'account_inactive' is not a valid view function or pattern name.

아래 사진은 소셜로그인으로 로그인시 유저 이메일 정보를 받고 유저가 존재하지않으면 회원가입을 시켜주는 부분인데 이부분에서 위 제목처럼 에러가 발생하였다.

kakao social login code

 

 

발생원인

user models

현재는 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

 

반응형