Most of the tutorials only show how to deploy a simple Flask hello world app on Heroku. But I have a Flask app which contains URLs with both GET and POST requests and they use MySQLdb library for fetching data from database.
How to set up such apps on Heroku? Currently I have a MySQL database on my local machine which is used by the code to fetch data. The Flask code contains many functions which are invoked by API calls. For example:
@app.route('/display_table', methods=['POST'])
def display_webstats():
db = MySQLdb.connect("localhost", "root", "root", "db_name")
cursor = db.cursor()
cursor.execute("select * from table_name")
ws = cursor.fetchall()
return jsonify(ws), 200
How to deploy such apps on Heroku?