我在网站的属性页面中创建了一个IIS express虚拟目录。但是,当我开始调试网站时。它会提示以下错误。
from django import forms
from django.shortcuts import render, HttpResponse
from .models import Schedule
class ScheduleForm(forms.ModelForm):
class Meta:
model = Schedule
fields = "__all__"
def multicreate(request):
if request.method == "POST":
forms = [
ScheduleForm(dict(name=n, date_from=df, date_to=dt, desc=ds))
for n, df, dt, ds in zip(
request.POST.getlist("name"),
request.POST.getlist("date_from"),
request.POST.getlist("date_to"),
request.POST.getlist("desc"),
)
]
if all(forms[i].is_valid() for i in range(len(forms))):
for form in forms:
form.save()
return HttpResponse(
f"success to create {len(forms)} Schedule instances."
)
else:
forms = [ScheduleForm() for _ in range(3)]
return render(request, "create.html", {"forms": forms})
我该如何解决?
答案 0 :(得分:0)
我猜你在web.config中有这样的部分:
<rewrite>
<rules>
<rule name="RequestBlockingRule1"
...
</rules>
</rewrite>
从错误中可以看出,您有两个名称设置为“RequestBlockingRule1”的条目。