Django path 路径参数和kwargs额外参数传递到视图层
from django.urls import path
from . import views
urlpatterns = [
path("<int:x>", views.index, name="index", kwargs = {"y":23}),
]
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request,x, y):
return HttpResponse("hello, world. You're at the polls index." + str(x) + str(y))