[Answered ]-How do I add a trailing slash for Django MPTT-based categorization app?

0👍

I ended up going with this solution: url(r'^(?P<full_slug>[-\w/]+)'...

1👍

This should match urls without trailing slash:

r'^(?P<full_slug>[-\w/]+)/$'

You can redirect this matches to full_slug + “/”.

1👍

Turns out my pattern was off slightly. The correct pattern in the URLConf is (r'^(?P<full_slug>[-\w/]+/)$'

Leave a comment