From bbad0dc726ad4e7d7e77ac5915e4db290b9d0fb6 Mon Sep 17 00:00:00 2001 From: SDE Date: Fri, 11 Aug 2023 12:37:07 +0300 Subject: [PATCH] 0.2.11 chat v2 --- AuthApp/js_urls.py | 2 ++ AuthApp/urls.py | 2 ++ AuthApp/views.py | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/AuthApp/js_urls.py b/AuthApp/js_urls.py index f071d50..c181a57 100644 --- a/AuthApp/js_urls.py +++ b/AuthApp/js_urls.py @@ -8,7 +8,9 @@ from RoutesApp.js_views import new_route_view_ajax urlpatterns = [ path('registration/', registration_ajax, name='registration_ajax'), + path('login/', login_ajax, name='login_ajax'), + # path('login/', login_ajax, name='login_ajax'), path('new_route_view/', new_route_view_ajax, name='new_route_view_ajax'), diff --git a/AuthApp/urls.py b/AuthApp/urls.py index f2aec95..18d01aa 100644 --- a/AuthApp/urls.py +++ b/AuthApp/urls.py @@ -11,7 +11,9 @@ urlpatterns = [ path('', user_profile_View, name='user_profile'), path('chat//', chat_w_user_View, name='chat_w_user'), path('chat/', chat_w_user_View, name='chat_w_user_wo_user_id'), + path('login/', login_View, name='login_profile'), + path('logout/', logout_View, name='logout_profile'), # ajax ---------------- diff --git a/AuthApp/views.py b/AuthApp/views.py index 0ddd074..ea76963 100644 --- a/AuthApp/views.py +++ b/AuthApp/views.py @@ -66,6 +66,13 @@ def user_profile_View(request): return response +def logout_View(request): + from django.contrib.auth import logout + from django.shortcuts import redirect + + logout(request) + return redirect('login_profile') + def login_View(request): Dict = {}