<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                前提: ~~~ url(r'^app/', include('app.urls',namespace='app')), url('^relation',views.relation,name='relation'), ~~~ 模板函數中的反向解析: ~~~ <a href="{% url 'app:relation' %}">相對路徑3</a> ~~~ 無論url怎么改變,只要視圖函數的名稱不變,模板都可以反向解析到該視圖函數。 若url中是非關鍵字參數: ~~~ url('^bbb/(\d+)/(\d+)/(\d+)',views.bbb,name='bbb'), ~~~ 反向解析按照順序傳參數: ~~~ <a href="{% url 'app:bbb' 2099 99 99 %}">相對路徑4</a> ~~~ 若url中是關鍵字參數: ~~~ url('^ccc/(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)',views.ccc,name='ccc'), ~~~ 反向解析可以不按照順序傳參數,但傳參時要寫關鍵字: ~~~ <a href="{% url 'app:ccc' month=10 day=13 year=2000%}">相對路徑5</a> ~~~ 視圖函數重定向的反向解析: ~~~ url('^fromHere',views.fromHere), url('^toHere',views.toHere,name='toHere'), ~~~ 視圖函數中的寫法: ~~~ def fromHere(request): return redirect(reverse('app:toHere')) def toHere(request): return HttpResponse('到這啦') ~~~ 這樣無論url中的toHere怎么改變,只要視圖函數名叫toHere就可以重定向到它。 若url中是非關鍵字參數: ~~~ url('^fromHere',views.fromHere), url('^toHere/(\d+)/(\d+)/(\d+)',views.toHere,name='toHere'), ~~~ 視圖函數中的寫法: ~~~ def fromHere(request): return redirect(reverse('app:toHere',args=(2018,8,8))) def toHere(request,year,month,day): return HttpResponse(str(year) + "年"+str(month) +"月"+str(day)+"日") ~~~ 若url中是關鍵字參數: ~~~ url('^fromHere',views.fromHere), url('^toHere/(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)',views.toHere,name='toHere'), ~~~ 視圖函數中的寫法: ~~~ def fromHere(request): return redirect(reverse('app:toHere',kwargs={"year":2020,"month":10,"day":10})) def toHere(request,year,month,day): return HttpResponse(str(year) + "年"+str(month) +"月"+str(day)+"日") ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看