When someone clicks on my site's logout link, I want them to be redirected to the login page but I want a message to pop up saying that they were successfully logged out. However, I don't want this behaviour to occur when someone normally visits the login page.
I decided to pass in a query string so now when someone hits logout they are redirected to users/login/?logout. How can I check for this in my template though? I want to do something like:
{% if ______ %}
*Message box appears*
{% endif %}
Thanks!
if logout in request.GET, it it does not work try to add a value to the logout parameter (?logout=1) and thenif request.GET.logoutin the template. Therequestobject should be available if the view uses a RequestContext (default if you are callingrenderor inheriting from a class based view)