diff --git a/core/__pycache__/urls.cpython-312.pyc b/core/__pycache__/urls.cpython-312.pyc index 370f0f97..1e0baeda 100644 Binary files a/core/__pycache__/urls.cpython-312.pyc and b/core/__pycache__/urls.cpython-312.pyc differ diff --git a/core/__pycache__/views.cpython-312.pyc b/core/__pycache__/views.cpython-312.pyc index cdc47c50..5a5d3319 100644 Binary files a/core/__pycache__/views.cpython-312.pyc and b/core/__pycache__/views.cpython-312.pyc differ diff --git a/core/urls.py b/core/urls.py index ff49beb9..23c1c820 100644 --- a/core/urls.py +++ b/core/urls.py @@ -48,6 +48,11 @@ path('send-contact/', views.send_contact_message, name='send_contact_message'), + path('logout/', views.logout_view, name='logout'), + + + + # path('about_us/', about_us, name='about_us'), # path('send-contact-email/', send_contact_email, name='send_contact_email'), #path('contact/', views.contact_form(), name='index'), diff --git a/core/views.py b/core/views.py index 8d6984dd..58b5eb1b 100644 --- a/core/views.py +++ b/core/views.py @@ -1,5 +1,5 @@ # from audioop import reverse -from django.contrib.auth import authenticate, login +from django.contrib.auth import authenticate, login,logout from imaplib import _Authenticator from django.urls import reverse from django.http import JsonResponse @@ -468,7 +468,7 @@ def login_view(request): login(request, user) # Redirect to a success page, or some other page # Replace 'home' with the name of your home URL pattern - return redirect('home') + return redirect('core:home') else: # Return an error message or handle invalid login return render(request, 'login.html', {'error_message': 'Invalid username or password.'}) @@ -535,3 +535,9 @@ def post(self, *args, **kwargs): # Default return statement in case none of the exceptions are caught return HttpResponse("An error occurred during checkout process.") + +def logout_view(request): + logout(request) + return redirect('core:login') + + diff --git a/db.sqlite3 b/db.sqlite3 index 05aaf50c..8afb3e49 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/demo/__pycache__/settings.cpython-312.pyc b/demo/__pycache__/settings.cpython-312.pyc index d5619444..423b0321 100644 Binary files a/demo/__pycache__/settings.cpython-312.pyc and b/demo/__pycache__/settings.cpython-312.pyc differ diff --git a/env/Lib/site-packages/django/core/mail/backends/__pycache__/__init__.cpython-312.pyc b/env/Lib/site-packages/django/core/mail/backends/__pycache__/__init__.cpython-312.pyc index ec81f217..5ecd00af 100644 Binary files a/env/Lib/site-packages/django/core/mail/backends/__pycache__/__init__.cpython-312.pyc and b/env/Lib/site-packages/django/core/mail/backends/__pycache__/__init__.cpython-312.pyc differ diff --git a/env/Lib/site-packages/django/core/mail/backends/__pycache__/base.cpython-312.pyc b/env/Lib/site-packages/django/core/mail/backends/__pycache__/base.cpython-312.pyc index 1d0d4995..14109a3d 100644 Binary files a/env/Lib/site-packages/django/core/mail/backends/__pycache__/base.cpython-312.pyc and b/env/Lib/site-packages/django/core/mail/backends/__pycache__/base.cpython-312.pyc differ diff --git a/env/Lib/site-packages/django/core/mail/backends/__pycache__/smtp.cpython-312.pyc b/env/Lib/site-packages/django/core/mail/backends/__pycache__/smtp.cpython-312.pyc index 0bd57b42..09812213 100644 Binary files a/env/Lib/site-packages/django/core/mail/backends/__pycache__/smtp.cpython-312.pyc and b/env/Lib/site-packages/django/core/mail/backends/__pycache__/smtp.cpython-312.pyc differ diff --git a/templates/checkout.html b/templates/checkout.html index aad4b640..5cdeb1cd 100644 --- a/templates/checkout.html +++ b/templates/checkout.html @@ -80,7 +80,8 @@