Django根据id查询表数据 url映射: urlpatterns = [ path('search', views.Search), ] view层: def Search(request): student_id = request.GET.get("id") students = StudentInfo.objects.get(stu_id=student_id) return HttpResponse(students.toJSON()) Response: