Quantcast
Channel: How to make trailing slash optional in django - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article


Answer 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 Article


How 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
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>