Django set urls conf on parents of apps with include and slug


For instance, we have urls.py like this:

1
(r’^insurances/’, include(‘insurances.urls’, namespace="insurances")),

Then we want to have slug on parent of apps by :

1
/insurances/slug

Then in our urls.py in apps:

1
url(r’^(?P<slug>[-w]+)/$’, ‘details’, name="details"),

Done! 😀


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.