URLs.py中提供的URL在Django 2中仍然得到404

问题描述 投票:0回答:1

我在views.py中编写了一个函数,如下所示

def removeinvoices(request,invoiceID,creatorID,deletorid,typeofchange):
form = invoicestorageForm()
form.invoiceid = invoiceID
form.creatorid = creatorID
form.deletorid = deletorid
form.typeofchange = typeofchange
form.save()
thatInvoice = taxInvoice.objects.filter(invoiceid=invoiceID).first()
thatInvoice.delete()
messages.success(request, "Invoice ID "+ invoiceID +" removed Successfully !")
return redirect("vieweinvoices")

并在urls.py中这样写:

    path("removeinvoices/<int:invoiceID>/<int:creatorID/><int:deletorid>/<str:typeofchange>", views.removeinvoices, name="removeinvoices",),

并且我在JS中动态生成href,可以按比例获取所有变量,但是当我单击href时仍然显示404错误。enter image description here

我可以使用图片中提到的所有其他URL。

不确定我要去哪里错了!

python django django-urls
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.