How to make nested menus of arbitrary depth?

How to make a pattern url for menus of arbitrary depth of view:
1) AAA
 1.1) BBB
 1.2) BSC
 1.2.1) VVV
2) shhhhh
 2.1) DDD

So, if you type in the address bar site.ru/1/1.2/1.2.1 then indulged in the view list [1, 1.2, 1.2.1].
July 9th 19 at 13:37
1 answer
July 9th 19 at 13:39
This is a very bad decision, is better not to attempt to use the variable argument long in the vyuha, but anything is possible.

urls.py
mapping includes = [
 url(r'^((\d+(\.\d+)*/)+)$', varargs),
]

views.py
def varargs(request, path, *args):
 path_list = [i for i in path.split('/') if i]

Find more questions by tags DjangoPython