↧
Answer by Yarrow for How to make trailing slash optional in django
Not a direct answer to the question, but may save headache for someone with case similar to mine.Trailing slash is optional by default because of APPEND_SLASH setting (if you include CommonMiddleware),...
View ArticleAnswer by Mojtaba Kamyabi for How to make trailing slash optional in django
You can use re_path instead of path for use regular expression in your url pattern. use ? sign in your url like this:from django.urls import re_pathre_path(r'url/?$', views.appmain, name="main")Note:...
View ArticleHow to make trailing slash optional in django
I have a django app. In the app I have a url that looks like:-path('url/', views.appmain, name="main")The problem is that the trailing slash is required. I want to make the slash optional and the url...
View Article