Forums

No module named 'flask_app'

Hello, I am new to Python Anywhere and I'm trying to set up a Flask web app I have already built. I followed this tutorial: https://help.pythonanywhere.com/pages/Flask/

But when I try to access the site the log says this:

Error running WSGI application
2018-07-24 11:25:47,696: ModuleNotFoundError: No module named 'flask_app'
2018-07-24 11:25:47,697:   File "/var/www/vdvaxel_pythonanywhere_com_wsgi.py", line 111, in <module>
2018-07-24 11:25:47,697:     from flask_app import app as application  # noqa

Can someone explain me what is wrong?

Check out this help page for information on how to debug that kind of error. Essentially, what's happening is that the system is looking for a file called flask_app.py in the directory you added to sys.path because it expects that that is where you defined your Flask app variable. If it's somewhere else, you'll need to adjust the WSGI file to reflect the actual location and name of your file.

Hello! I am interresting by the solution. Did you find?

Work through the help page I posted previously to debug the problem.