Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
104 views
in Technique[技术] by (71.8m points)

python - When I try to logout showing Page not found (404)

Whenever I click log out this error is showing enter image description here

My html is:

enter image description here

views.py :

enter image description here

apps urls.py :

enter image description here

projects urls.py :

enter image description here

question from:https://stackoverflow.com/questions/65882617/when-i-try-to-logout-showing-page-not-found-404

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

you need to add the specific path.

try this

<a href="{% url 'logout' %}>Logout</a>

Please read this https://docs.djangoproject.com/en/3.1/ref/urls/

also this https://docs.djangoproject.com/en/3.1/ref/templates/builtins/#url


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...