Edit URLs and add views.py

main
Samuel Zielke 2 years ago
parent 000aed8677
commit 26d330fa16

@ -15,8 +15,13 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path, include
from .views import logout_view
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('login/', include(('login.urls', 'login'), namespace='login')),
path('', include('login.urls')),
path("accounts/login/", include('login.urls')),
path("logout/", logout_view)
] ]

@ -0,0 +1,7 @@
from django.shortcuts import redirect
from django.urls import reverse
from django.contrib.auth import logout
def logout_view(request):
logout(request)
return redirect(reverse('login:login'))
Loading…
Cancel
Save

Powered by TurnKey Linux.