Hello,
I am trying to deploy a Dash application (built on top of Flask) at the url: https://jonathanbechtel.pythonanywhere.com
I read the post here: https://help.pythonanywhere.com/pages/DashWSGIConfig/ and change my wsgi configuration file so it reads in the following way:
import sys
# add your project directory to the sys.path
project_home = '/home/jonathanbechtel/covid-app/src'
if project_home not in sys.path:
sys.path = [project_home] + sys.path
# import flask app but need to call it "application" for WSGI to work
from app import app # noqa
application = app.server
My main file is called app.py
When I do this the application does not load and the error message is the following:
Error running WSGI application
2021-01-19 04:26:35,013: AttributeError: 'Flask' object has no attribute 'server'
2021-01-19 04:26:35,013: File "/var/www/jonathanbechtel_pythonanywhere_com_wsgi.py", line 17, in <module>
2021-01-19 04:26:35,014: application = app.server
If I change the import line in wsgi.py to
from app import app as application
Then the site just spits out a generic 'hello from flask!` welcome page.
Any help would be appreciated. Thank you.