My problem is similar to Flask and Gunicorn in Heroku import error and Procfile gunicorn computer_name , but I can not fix it using their solutions.
My Flask application 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"
I used to experience errors when starting foreman start , but those left as soon as I removed import appname.views from app.py
Now foreman start launches the application, and the / route is accessible, but /there is not. How did it happen?
Caroline
source share