관리 메뉴

웹개발자의 기지개

[Django] You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set 본문

python/Django

[Django] You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set

http://portfolio.wonpaper.net 2022. 5. 5. 18:00

RuntimeError at /member/register

You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/member/register/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.

Request Method: POST
Request URL: http://127.0.0.1:8000/member/register
Django Version: 4.0.4
Exception Type: RuntimeError
Exception Value: You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/member/register/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings.
Exception Location: /Users/jongwon/PycharmProjects/django_test2/venv/lib/python3.10/site-packages/django/middleware/common.py, line 88, in get_full_path_with_slash
Python Executable: /Users/jongwon/PycharmProjects/django_test2/venv/bin/python
Python Version: 3.10.4
Python Path: ['/Users/jongwon/PycharmProjects/django_test2',
 '/Library/Frameworks/Python.framework/Versions/3.10/lib/python310.zip',
 '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10',
 '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload',
 '/Users/jongwon/PycharmProjects/django_test2/venv/lib/python3.10/site-packages']
Server time: Thu, 05 May 2022 12:30:17 +0900

 

127.0.0.1:8000/member/register/  와 같이 매일 끝단에 슬러쉬를 붙여야 된다는 이야기이다. 

아니면, settings.py 안에 APPEND_SLASH=False 를 붙여넣으라는 에러 메세지이다.

Comments