2

I keep getting emails from django about broken INTERNAL links which I can't explain:

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

It seems that they are due to a contact form on the referrer page, which after successful submission redirects to http://www.emetor.com/thanks/. When I try a contact submission, everything works just fine. But I'm afraid that I might miss some contact submissions!

Somebody who has an explanation about where the problem could be? Please let me know if you need further information...


The contact form does the following:

<form action="/contact/" method="post">

And in the view for contact:

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}))
Meilo
  • 3,378
  • 3
  • 28
  • 34

1 Answers1

1

Log file shows that requested url is "/thanks/forum/", although you mention that successful submission redirect is "/thanks", so check the code where redirect url is created.

Other explanation could be that this link is saved by some crawler or bot and it try to request that page.

bmihelac
  • 6,233
  • 34
  • 45
  • Thank you for your answer. I added the code where the redirect url is created in my question, do you see something strange? – Meilo Jun 17 '11 at 07:42
  • Maybe your second explanation with some crawler or bot is the most reasonable, or would they not rather get a 404 page not found? – Meilo Jun 17 '11 at 07:51
  • Code looks fine. I would say that this is a bot crawling. Check other details in access log to see if always same IP address and user agent are trying to fetch that url. – bmihelac Jun 17 '11 at 10:33