I'm trying to develop my first "large" app with Flask on Heroku and I'm attempting to combine the basic tutorial here: https://devcenter.heroku.com/articles/python with the instructions here: http://flask.pocoo.org/docs/patterns/packages/#larger-applications. It works locally with "foreman start" but when I push to Heroku I get an error that the wrong port is in use:
Starting process with command
python run.py
2012-12-04T23:45:18+00:00 app[web.1]: * Running onhttp://127.0.0.1:5000/
2012-12-04T23:45:18+00:00 app[web.1]: * Restarting with reloader 2012-12-04T23:45:23+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 5000, should be 33507 (see environment variable PORT)
I'm new to all this, but it looks like it's trying to run "locally" on Heroku. I've tried all sorts of combinations, but can't get it to work. My very simple code right now is (the app is called "pml"):
directory: /pml
Procfile:
web: python run.py
run.py:
from pml import app
app.run(debug=True)
directory: /pml/pml/
__init__.py
from flask import Flask
app = Flask(__name__)
import pml.views
view.py
from pml import app
@app.route('/')
def index():
return 'Hello World!'