홈페이지에서 로그인 눌렀는데 이 에러가 나오네요 …

질문 포럼분류: 강의 관련 질문홈페이지에서 로그인 눌렀는데 이 에러가 나오네요 …
이형권 질문함 11달 전

TemplateDoesNotExist at /accounts/login/
bootstrap4/uni_form.html
Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/login/
Django Version: 4.2.1
Exception Type: TemplateDoesNotExist
Exception Value:
bootstrap4/uni_form.html
Exception Location: C:\web\dshop\env1\lib\site-packages\django\template\backends\django.py, line 84, in reraise
Raised during: allauth.account.views.LoginView
Python Executable: C:\web\dshop\env1\Scripts\python.exe
Python Version: 3.10.9
Python Path:
[‘C:\\web\\dshop’,
‘C:\\Users\\wofvh\\AppData\\Local\\anaconda3\\python310.zip’,
‘C:\\Users\\wofvh\\AppData\\Local\\anaconda3\\DLLs’,
‘C:\\Users\\wofvh\\AppData\\Local\\anaconda3\\lib’,
‘C:\\Users\\wofvh\\AppData\\Local\\anaconda3’,
‘C:\\web\\dshop\\env1’,
‘C:\\web\\dshop\\env1\\lib\\site-packages’]
Server time: Wed, 31 May 2023 09:20:23 +0000
Template-loader postmortem
Django tried loading these templates, in this order:

Using engine django:

django.template.loaders.filesystem.Loader: C:\web\dshop\templates\bootstrap4\uni_form.html (Source does not exist)
django.template.loaders.app_directories.Loader: C:\web\dshop\env1\lib\site-packages\django\contrib\admin\templates\bootstrap4\uni_form.html (Source does not exist)
django.template.loaders.app_directories.Loader: C:\web\dshop\env1\lib\site-packages\django\contrib\auth\templates\bootstrap4\uni_form.html (Source does not exist)
django.template.loaders.app_directories.Loader: C:\web\dshop\env1\lib\site-packages\allauth\templates\bootstrap4\uni_form.html (Source does not exist)
django.template.loaders.app_directories.Loader: C:\web\dshop\env1\lib\site-packages\debug_toolbar\templates\bootstrap4\uni_form.html (Source does not exist)
Error during template rendering
In template C:\web\dshop\templates\account\login.html, error at line 42

bootstrap4/uni_form.html

1 답변
user 스탭 답변함 11달 전

안녕하세요.
이 오류는 템플릿이 존재하지 않아 발생하는 문제로 보입니다. 오류 메시지에서 `bootstrap4/uni_form.html` 템플릿을 찾지 못하고 있는 것으로 보입니다. 이 오류는 다양한 이유로 발생할 수 있습니다.
가능한 원인과 해결 방법은 다음과 같을 수 있습니다:
1. 템플릿 경로 확인: 오류 메시지에서 템플릿을 찾기를 시도한 경로들이 제시되어 있습니다. 해당 경로들이 실제로 존재하는지 확인해야 합니다. `C:\web\dshop\templates\bootstrap4\uni_form.html` 파일이 존재하는지 확인하세요. 템플릿 파일이 다른 경로에 위치해 있다면, `settings.py` 파일의 `TEMPLATES` 설정 부분을 확인하여 정확한 템플릿 경로를 설정했는지 확인하세요.
2. 패키지 설치 확인: `bootstrap4`와 `django-uni-form` 패키지가 설치되어 있는지 확인하세요. 이 템플릿은 `django-uni-form` 패키지에 포함되어 있을 수 있습니다. 필요한 패키지가 설치되어 있지 않다면, `pip` 명령을 사용하여 패키지를 설치하세요.
3. STATIC_URL 설정 확인: `settings.py` 파일에서 `STATIC_URL` 설정을 확인하세요. 템플릿에서 정적 파일을 찾을 때 사용되는 경로입니다. 정적 파일이 위치한 경로를 정확하게 설정해야 합니다.
4. Django 버전 확인: 사용 중인 Django 버전과 `django-uni-form` 패키지의 호환성을 확인하세요. 오래된 버전의 `django-uni-form` 패키지는 최신 버전의 Django와 호환되지 않을 수 있습니다.
위의 해결 방법을 시도하면서 문제가 해결되지 않을 경우, 더 많은 정보가 필요할 수 있습니다. Django 버전, 설치된 패키지 목록, `settings.py` 파일의 내용 등과 함께 추가적인 정보를 제공해주시면 더 자세한 도움을 드릴 수 있습니다.

shop2school 제휴 문의1-302-613 -1812 |이메일 info@shop2world.com | 법인명: SHOP2WORLD, INC. | 2801 CENTERVILLE RD 1ST FLOOR PMB 8085 WILMINGTON DE 19808 USA.