I have a simple Flask app that I'm trying to deploy to Heroku, but I'm facing an Application Error and the logs seem to indicate that the app is stuck in some sort of restarting loop. I think there is a problem with my Procfile or run.py but I can't figure out what. Here are the Heroku logs:
2014-07-13T03:02:24.579923+00:00 app[web.1]: * Running on http://127.0.0.1:5000/
2014-07-13T03:02:24.580216+00:00 app[web.1]: * Restarting with reloader
2014-07-13T03:02:29.941158+00:00 app[web.1]: /app/app/mechanize_boilerplate.py:13: UserWarning: gzip transfer encoding is experimental!
2014-07-13T03:02:29.941168+00:00 app[web.1]: br.set_handle_gzip(True)
2014-07-13T03:02:29.955461+00:00 app[web.1]: * Running on http://127.0.0.1:5000/
2014-07-13T03:02:29.955738+00:00 app[web.1]: * Restarting with reloader
2014-07-13T03:02:35.300236+00:00 app[web.1]: br.set_handle_gzip(True)
2014-07-13T03:02:35.300231+00:00 app[web.1]: /app/app/mechanize_boilerplate.py:13: UserWarning: gzip transfer encoding is experimental!
2014-07-13T03:02:35.314821+00:00 app[web.1]: * Running on http://127.0.0.1:5000/
2014-07-13T03:02:35.315107+00:00 app[web.1]: * Restarting with reloader
...
Here is my current project structure:
/myapplication
Procfile
run.py
requirements.txt
/app
__init__.py
views.py
mechanize_boilerplate.py
/static
/templates
Here is my Procfile
web: gunicorn run:app
Here is run.py
#!flask/bin/python
from app import app
app.run(debug = True)
Here is init.py
from flask import Flask
app = Flask(__name__)
from app import views
From there views.py runs and is pretty classic. I've seen a few similar questions and tried playing with my Procfile but couldn't get it work, all I managed to do was crashing the app. Any suggestions?