路由分发的本质

Posted huikejie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了路由分发的本质相关的知识,希望对你有一定的参考价值。

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)),

]

 

以上是关于路由分发的本质的主要内容,如果未能解决你的问题,请参考以下文章

stark组件前戏之django路由分发的本质include

路由重分发

路由重分发

OSPF路由协议之“路由重分发”及“NSSA区域”

OSPF路由重分发

路由重分发及配置