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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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

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

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

4 回答

?
慕碼人2483693

TA貢獻1860條經(jīng)驗 獲得超9個贊

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

]

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

TA貢獻1827條經(jīng)驗 獲得超4個贊

流線型化(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'),

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

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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