I added the following before_request code in my flask_app.py:
app = Flask(__name__)
app.debug = True
@app.before_request
def before_request():
print 'REQUEST HEADERS'
print request.headers
@app.route("/", methods=['GET','POST'])
On successfully sending a message from my phone to plivo and getting a response I get the following in the server log:
2016-01-19 16:34:31 X-Real-Ip: 54.XX.XX.XXX#015#012Content-Length: 172#015#012User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.35 Safari/535.1#015#012Connection: close#015#012Host: florisvb.pythonanywhere.com#015#012Accept: /#015#012X-Forwarded-For: 54.XX.XX.XXX#015#012X-Plivo-Signature: XXXXXXXXXXXXXXXXXXXXXXXXXXX=#015#012Content-Type: application/x-www-form-urlencoded#015#012Accept-Encoding: gzip, deflate#015#012#015
(the XXX's replace various numbers and letters)
On a failed message, I don't get anything printed to the server log, or the error log.
Did I put the before_request decorator in the right file (or should it be in the wsgi file?)?
Debugging this problem is obnoxious, as I have to wait 24 hours between restarting my python anywhere server before I can see what happens with a failed message.