码迷,mamicode.com
首页 > 其他好文 > 详细

路由分发的本质

时间:2019-07-31 16:55:49      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:admin   ext1   pre   rtc   dex   shortcut   one   url   span   

from django.conf.urls import url
from django.contrib import admin

from django.shortcuts import HttpResponse


# 路由分发的本质
def test1(request):
    return HttpResponse(text1)


def test2(request):
    return HttpResponse(text2)


def test3(request):
    return HttpResponse(text3)


def test4(request):
    return HttpResponse(text4)


def test5(request):
    return HttpResponse(text5)


def test6(request):
    return HttpResponse(text6)



#路由分发的本质

urlpatterns = [
    url(r^admin/, admin.site.urls),
    url(r^index/, ([url(rtext1/, ([
                                          url(rtext_1, test1),
                                          url(rtext_2, test2),
                                          url(rtext_3, test3),
                                          url(rtext_4, ([url(rtext_5, test5)], None, None)), ], None, None)),
                      url(rtext2/, test6)], None, None)),

]

 

路由分发的本质

标签:admin   ext1   pre   rtc   dex   shortcut   one   url   span   

原文地址:https://www.cnblogs.com/huikejie/p/11277174.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!