Django Tutorial #23 - logging users out

preview_player
Показать описание

----- COURSE LINKS:

======== Other Tutorials =========

----- NODE.JS TUTORIALS

----- MONGODB TUTORIALS

======== Social Links ==========

Рекомендации по теме
Комментарии
Автор

Something that should be noted somewhere sticky is that the reason you should use POSTs for logout actions is because some browsers / web accelerators will (still) prefetch links they think you will use. Most are intelligent enough to know not to prefetch a logout link, but you can't be sure. Prefetching the logout link will log you out, in case it wasn't obvious...

jason.doller
Автор

First of all let me say, your tutorials are awesome and you do a great and thorough job of explaining everything. When I got to this portion of the tutorial my base_layout structure was different than yours. Did I miss something or did you change it. There seemed to be a sudden injection of a header tag that wasn't in my code. Here's a portion of what I have:
<body>
<div class="wrapper">
<h1><a href="{% url 'articles:list' %}"><img src="{% static 'logo.png' %}" alt=""></a></h1>
{% block content %}
{% endblock %}
</div>
</body>

Your block:
<header class="wrapper">
<h1><a href="{% url 'articles:list' %}"><img src="{% static logo.png' %}" alt=""></a></h1>
<nav>
...
</header>
<div class="wrapper">
...

steveharrington
Автор

One thing about you is that you are not lazy my friend. Sending best wishes

yusufrumi
Автор

can not wait for your next videos to complete this awesome series..excellent explanation

wisamkhalid
Автор

This series is still mostly useful with Django 3 in 2021.

jason.doller
Автор

you are awesome... please make a search function too

MrSaeedalhakimi
Автор

nice..am waiting for next...super bro..

learnanywhere
Автор

Hi, I did exactly what you did. However when clicking on the logout button I get the following error: "Forbidden (csrf cookie not set)". I have added the {% csrf_token %} in the template though. Can you help?
Ps: your tutorials are so clear and helpful! Thank you!

olivierflorent
Автор

hi, I have a question. instead of using a form to process logout, what is the disadvantage of just using a link that calls a view function with the logout method?

abdulwahabadi
Автор

I've a question for you. Why post request is more recommended way(best practise) to logout then get? It just doesn't makes sense. For logout get request is enough and I think its even better then post. Usually we use post to send large data but logout don't require any data, you are just deleting user session

DaAaRcCcHOoO
Автор

i did the same thing you did but i am getting this error "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 "

fahimchowdhury
Автор

even i logged out when press my browser's back buttom i'm still able to see previously cached page is ther any solution for this?

JinoyKS-vkmf
Автор

The view man.views.logout_detail didn't return an HttpResponse object. It returned None instead.

learnanywhere
Автор

1:21 them url logout trong urls
2:21 tao ham logout trong views
4:11 tao html logout trong base_layout

DuongTran-zhtd