My problem is similar to Flask and Gunicorn on Heroku import error and Procfile gunicorn custom module name but I can't seem to fix it using their solutions.
My Flask app has the following structure:
appname/
run.py
Procfile
venv/
...
appname/
app.py
views.py
run.py:
from appname import app
app.run(debug=True)
app.py:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return "here"
Procfile:
web: gunicorn --pythonpath appname app:app
views.py:
from appname import app
from flask import render_template
@app.route('/there')
def there():
return "there"
Previously, I was experiencing erorrs when running foreman start
, but those went away once I removed import appname.views
from app.py
.
Now, foreman start
runs the app and route /
is accessible but /there
is not. How come?
/
-route not in theviews.py
? – msvalkon