title: Flask app raises a 500 error with no exception
body: <p>I've been banging my head against this method in Flask for some time, and while it seems I'm making progress now, I've just happened upon something that baffles me to no end. Here is the method I'm calling:</p>
  
  <pre><code>@app.route('/facedata/&lt;slug&gt;', methods=["POST"])
  def facedata(slug):
      if request.method == "POST":
          try:
              post = Post.objects.get_or_404(slug=slug)
              data = [float(item) for item in request.form.getlist('emotions[]')]
              post.face_data.append(data)
              post.save()
          except:
              traceback.print_exc(file=sys.stdout)
  </code></pre>
  
  <p>For a long time I was getting errors in here that would then be caught in the heroku logs. Currently there are no errors, implying that it doesn't reach the except loop, but even worse, there are still 500 errors. Specifically the 500 errors I get are:</p>
  
  <pre><code>heroku[router]: at=info method=POST path=/facedata/StripedVuitton host=cryptic-mountain-6390.herokuapp.com fwd="18.111.90.180" dyno=web.2 connect=4ms service=39ms status=500 bytes=291
  </code></pre>
  
  <p>I'm sending these <code>POST</code> requests via AJAX in this method:</p>
  
  <pre><code>var slug = document.getElementById("hidden-slug").getAttribute("value");
  data = {emotions: lRes};
  $.ajax({
      type: "POST",
      data: data,
      url: document.location.origin + "/facedata/" + slug,
      success: function(){
          console.log("Success!");
      }
  });
  </code></pre>
  
  <p>Quite honestly I just don't know how to continue debugging this problem. It doesn't make a lot of sense to me to be getting a traceback without an exception, but maybe I'm just being naive.</p>
  
  <p>I'm using mongoengine on top of MongoHQ on Heroku if that's relevant.</p>