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