Note that there are some explanatory texts on larger screens.

plurals
  1. PODebugging 500 on incoming Mail on Heroku from Mailgun
    primarykey
    data
    text
    <p>I'm trying to debug a view which gets an incoming mail from Mailgun to a Django installation on Heroku.</p> <p>The view itself is directly taken from the Mailgun docs and if I manually call the URL then I get an OK response.</p> <pre><code>@csrf_exempt def askfriend_emailresponse(request): from_email = "..." to_email = "..." if request.method == 'POST': sender = request.POST.get('sender') recipient = request.POST.get('recipient') answer = request.POST.get('stripped-text', '') try: send_mail("inside post"+str(recipient[recipient.find("+")+1:recipient.find("@")]), answer, from_email, to_email) except Exception, e: raise e return HttpResponse('OK') </code></pre> <p>Also, if I just place a post to that URL through an external tool (I'm using Poster for this purpose) I can get the 200 (I had to add the <code>@csrf_exempt</code> for that but that's fine for now).</p> <p>However, from the Mailgun logs I see that there is a 500 Error when forwarding the message and from Heroku I see there is an incoming request causing a 500:</p> <pre><code>2013-03-13T09:59:04+00:00 heroku[router]: at=info method=POST path=[url] host=[hostname].herokuapp.com fwd="198.61.253.112" dyno=web.1 queue=0 wait=0ms connect=1ms service=86ms status=500 bytes=102194 </code></pre> <p>My questions after spending more than a day researching:</p> <p>1) Any idea what could be wrong (would be nice) - and at least as important</p> <p>2) How can I properly test this? Because Mailguns logs are very brief (500 - that's it!) and Heroku also doesn't really help there... Also, having to always deploy to Heroku first obviously is quite slow, hence, I'm wondering if that really is the "smart" way to develop... (all other things I obviously test locally but with an external e-mail coming through a POST through Mailgun I don't know how to test that locally)</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload