Add Button to Log out on home page, configure redirects after logout
This commit is contained in:
@@ -7,5 +7,9 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Moin moin!</h1>
|
<h1>Moin moin!</h1>
|
||||||
|
<form action="{% url 'logout' %}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button type="submit">Abmelden</button>
|
||||||
|
</form>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -5,6 +5,6 @@ from django.contrib.auth.views import LoginView
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', views.home, name='home'),
|
path('', views.home, name='home'),
|
||||||
path('logout/', LogoutView.as_view(), name='logout'),
|
path('logout/', LogoutView.as_view(next_page='login'), name='logout'),
|
||||||
path('login/', LoginView.as_view(template_name='accounts/login.html', next_page='home'), name='login'),
|
path('login/', LoginView.as_view(template_name='accounts/login.html', next_page='home'), name='login'),
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user