第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

請(qǐng)問django的templates和url,views之間的關(guān)系怎么弄?

請(qǐng)問django的templates和url,views之間的關(guān)系怎么弄?

滄海一幻覺 2019-08-19 17:13:20
django的templates和url,views之間的關(guān)系怎么弄
查看完整描述

4 回答

?
慕碼人2483693

TA貢獻(xiàn)1860條經(jīng)驗(yàn) 獲得超9個(gè)贊

django2.0 的代碼和1。x的代碼在這個(gè)是完全不一樣的。。。。
urlpatterns = [
path('', views.index, name='index'),
path('topics/', views.topics, name='topics'),
path('topics/(?P<topic_id>\d+)/', views.topic, name='topic'),

]

查看完整回答
反對(duì) 回復(fù) 2019-08-24
?
GCT1015

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超4個(gè)贊

流線型化(streamlinling)函數(shù)導(dǎo)入1:直接導(dǎo)入視圖函數(shù) from django.conf.urls.defaults import * from mysite.views import hello urlpatterns = patterns('', (r'^hello/$', hello), (r'^time/$', time), )2:導(dǎo)入包函模塊名和函數(shù)的客串,而不是函數(shù)本身 from django.conf.urls.defaults import * from mysite import views urlpatterns = patterns('', (r'^hello/$', 'views.hello'), (r'^time/$', 'views.time'),

查看完整回答
反對(duì) 回復(fù) 2019-08-24
  • 4 回答
  • 0 關(guān)注
  • 1153 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)