From 5f8fe95ef1826a2f2cc1d44b0fd8dd1a3019f37e Mon Sep 17 00:00:00 2001 From: Lucas Schumacher Date: Fri, 28 Jun 2024 14:26:30 -0400 Subject: [PATCH] Add Logout button --- django_auth/settings.py | 3 ++- templates/home.html | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/django_auth/settings.py b/django_auth/settings.py index 6a7dd8a..e8ac2e6 100644 --- a/django_auth/settings.py +++ b/django_auth/settings.py @@ -122,4 +122,5 @@ STATIC_URL = 'static/' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -LOGIN_REDIRECT_URL = "/" +LOGIN_REDIRECT_URL = "home" +LOGOUT_REDIRECT_URL = "home" diff --git a/templates/home.html b/templates/home.html index f510ad9..cb932c5 100644 --- a/templates/home.html +++ b/templates/home.html @@ -5,6 +5,10 @@ {% block content %} {% if user.is_authenticated %} Hi {{ user.username }}! +
+ {% csrf_token %} + +
{% else %}

You are not logged in

Log In