项目url:
path('', include(('app01.urls', 'wdc'), namespace='wdc')),
应用url:
path('<int:www>/', views.show, name='show'),
视图:
def show(request, www): return render(request, 'show.html', {'shuzi': www})
模板:
连接:
<a href="{% url 'wdc:show' 100 %}">显示</a> {# 传递参数100 #}
显示:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>显示</title> </head> <body> 显示{{ shuzi }} </body> </html>