例如:
from django.urls import include, path
urlpatterns = [
path('index/', views.index, name='main-view'),
path('bio/<username>/', views.bio, name='bio'),
path('articles/<slug:title>/', views.article, name='article-detail'),
path('articles/<slug:title>/<int:section>/', views.section, name='article-section'),
path('weblog/', include('blog.urls')),
...
]
{1>不想从请求中得到一个值
我使用Django 1.8.2
如果只想要实数
path
,可以使用request.path
。doc如果您想要}函数。在
<slug:title>
参数,只需通过function arguments
进入{编辑
你需要这两个函数。在
^{pr2}$必须在^{上设置
name
最后你可以得到你的模式在你的看法。在
相关问题 更多 >
编程相关推荐