Here is something i wanna ask if i try this code i can go to login page but my url look like this http://127.0.0.1:8000/%2Flogin/. What is this %2F?
urlpatterns = [
path("", views.index, name="index"),
path("<str:slug>", views.redirect, name='redirect'),
path('/login/', views.logIn, name='login')]
And i remove slash from login url i get an error message
Page not found (404) Request Method:
GET Request URL:
http://127.0.0.1:8000//login/
after removing slashes here is the code
urlpatterns = [
path("", views.index, name="index"),
path("<str:slug>", views.redirect, name='redirect'),
path('login', views.logIn, name='login')]
So, i wanna know is that why are the slashes affecting the url for login but not <str:slug>
%2Fis encoded url character/, browser will automatically encodes/decodes it.