django路由的二级分发

基于二级分发设计url路由
path('index/', views.index),
path('index/', ([
                    path('test01/', test01),
                    path('test02/', test02),
                ], None, None)),

# 二级分发

path('index/', ([
                    path('name/', ([
                                       path('alex/', test01),
                                       path('egon/', test02),
                                   ], None, None)),
                    path('shop/', ([
                                       path('apple/', test03),
                                       path('xiaomi/', test04),
                                       path('huawei/', test05),
                                   ], None, None)),
                ], None, None)), 
posted @ 2019-12-17 10:45  XuMou  阅读(333)  评论(0编辑  收藏  举报