???????????? namespace

Posted

tags:

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

?????????return   ??????   ????????????   app   name   TE   div   turn   namespace   

 

??????name??????????????????Django?????????URL????????????????????????????????????????????????????????????name??????URL??????????????????

??????????????????????????????????????????name???????????????URL??????????????????????????????name?????????????????????URL?????????????????????????????????????????????????????????????????????
 
 
??????Django??????namespace??????
 
from django.conf.urls import url,include
#?????????????????????????????????????????????
urlpatterns = [
    url(r???^aaa???, include("app01.urls"),namespace=???aaa???)),
    url(r???^bbb???, include("app02.urls"),namespace=???bbb???)),
]

#??????app01??????
from django.conf.urls import url from app01 import views app_name = "app01" urlpatterns = [ url(r???aaa/$???, views.aaa, name="index"), ]
def aaa(request):
    return HttpResponse(reverse("app01:index"))
#??????app02?????????????????????????????????name??????
from django.conf.urls import url from app01 import views app_name = "app02" urlpatterns = [ url(r???aaa/$???, views.aaa, name="index"), ]
def aaa(request):
    return HttpResponse(reverse("app02:index"))

????????????
#http://127.0.0.1/aaa/aaa/
# ?????????
# /aaaaaa/

#http://127.0.0.1/bbb/aaa/
# ????????? # /bbbaaa/

以上是关于???????????? namespace的主要内容,如果未能解决你的问题,请参考以下文章

Android Adapter代码片

代码片|水波纹

关于命名空间namespace

代码片--练习匿名内部类

一个简单的时间片轮转内核代码的分析(课程作业)

markdown 放代码片