Skip to content

Commit

Permalink
*
Browse files Browse the repository at this point in the history
  • Loading branch information
s3bu7i committed Mar 17, 2024
1 parent 1e8fbc5 commit b46e808
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 4 deletions.
Binary file modified core/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file modified core/__pycache__/views.cpython-312.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
10 changes: 8 additions & 2 deletions core/views.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.'})
Expand Down Expand Up @@ -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')


Binary file modified db.sqlite3
Binary file not shown.
Binary file modified demo/__pycache__/settings.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion templates/checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ <h4 class="mb-3" style=" margin-top: 26px;">Billing address</h4>
<select class="custom-select d-block w-100" id="state" required>
<option value="">Choose...</option>
<option>California</option>
<option>Yangon</option>
<option>Turkey</option>
<option>Baku</option>

</select>
<div class="invalid-feedback">
Expand Down
2 changes: 1 addition & 1 deletion templates/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
>
</li>
<li>
<a href="">Logout</a>
<a href="{% url 'core:logout' %}">Logout</a>
</li>
{% else %}
<li>
Expand Down

0 comments on commit b46e808

Please sign in to comment.