Add Optional Slash Syntax for Path

2019-08-28 Thread Jason Brill
As re_path and url syntax utilize regex, true optional trailing slashes are allowed for with the following example: re_path(r'^about/?$', AboutView.as_view(), name='about') In this example, a request to both /about and /about/ would yield a 200 response. Using *path* would look like this: p

Re: Add Optional Slash Syntax for Path

2019-08-29 Thread Jason Brill
s the way to go. (path() being > a convenience, rather than a replacement.) > > For me, complicating the signature of path() for such a corner case > wouldn’t be a good trade-off. > > Kind regards, > Carlton. > > On Wed, 28 Aug 2019 at 20:47, Jason Brill > >