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 = {}