vendredi 4 décembre 2020

slash ('/') is being automatically added to path ,even i havn't included it to my URLs and this is why it is giving PAGE NOT FOUND error

I have created a small project, and if i go to registration section. slash (/) gets added to URL automatically and says page not found. I have not included '/' in my code though

This is my urls.py

from django.urls import path
from . import views

urlpatterns = [

path('register',views.register, name = 'register'),  # no slash over here


path('login',views.login,name = 'login'),
path('logout',views.logout,name='logout'),
path('checkPincode',views.check,name `enter code here`= 'check'),
]

this is navigation section of index.html

<div class="topnav">
    <a href="/" style="background-color:black; color:#54dfd8;">VIVER FOODS</a>
    <a href="#menu">Food Menu</a>
    <a href="cart/your-cart">Cart</a>
    <a href="help/questions">Help</a>
    
    <a href="accounts/register" style="float:right;">SignUp</a>
    <a href="accounts/login" style="float:right;">logIn</a>

    
</div>

The thing is LOGIN working fine 🤷‍♂️.




Aucun commentaire:

Enregistrer un commentaire