250x250
반응형
Notice
Recent Posts
Recent Comments
Link
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Archives
Today
Total
관리 메뉴

BEAT A SHOTGUN

[TROUBLESHOOTING] ConnectionRefusedError: [WinError 10061] No connection ... or DoesNotExist: Site matching query does not exist. 본문

TROUBLESHOOTING

[TROUBLESHOOTING] ConnectionRefusedError: [WinError 10061] No connection ... or DoesNotExist: Site matching query does not exist.

thovy 2023. 7. 5. 16:25
728x90
반응형
SMALL

Django 를 이용해 User Create 를 시도하고 있었다.
Database 에 잘 저장되지만, 에러페이지를 출력했다.
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it 혹은
DoesNotExist: Site matching query does not exist 라는 에러.

어떤 상황에서 어떻게 해결할 수 있는지 한 번 알아보자.

시작

우선 현재 환경은
Django 를 사용해서 서버를 만들고 있는 중이다.
Djangorestframework 를 사용하고
dj-rest-auth, allauth 를 사용하고 있다.

email 항목

우선 user 에서 email 항목을 받지 않는다면 두 에러는 발생하지 않는다.

하지만 email을 받아야한다면,

site matching error

settings.pySITE_ID = {num} 가 없으면 Site matching error 가 발생하는 것을 알 수 있다.

Connection Refused Error

settings.pyEMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' 가 없으면 Connection refused Error 가 발생한다.

SOLUTION ✅

settings.py 에 두 항목을 넣어주자.

/settings.py

...

SITE_ID = 1

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

...

여담.

email 주소가 이상한 것과는 상관없다. (ex. emailtest1@test.com)

없거나. 저 항목들을 추가하거나.

728x90
반응형
LIST
Comments