我不断收到来自 django 的关于损坏的内部链接的电子邮件,我无法解释:
Referrer: http://www.emetor.com/forum/
Requested URL: /thanks/forum/
User agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
IP address: xxx.xxx.xxx.xxx
似乎它们是由于引荐页面上的联系表格,成功提交后重定向到http://www.emetor.com/thanks/。当我尝试联系人提交时,一切正常。但我担心我可能会错过一些联系人提交!
有人对问题可能出在哪里有解释吗?如果您需要更多信息,请告诉我...
联系表执行以下操作:
<form action="/contact/" method="post">
在联系视图中:
def contact(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactForm(request.POST) # A form bound to the POST data
if form.is_valid(): # All validation rules pass
...
send_mail(subject, message, sender_email, recipients)
return HttpResponseRedirect('/thanks/') # Redirect after POST
else:
form = ContactForm() # An unbound form
return render_to_response('contact.html', RequestContext(request,{'form': form}))