Forums

Why i do get these import error messages, i tried to debug it by removing the flask migrate but nothing has changed

.

2023-11-22 09:30:46,525: Error running WSGI application
2023-11-22 09:30:46,525: RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set.
2023-11-22 09:30:46,526:   File "/var/www/stephen420_pythonanywhere_com_wsgi.py", line 16, in <module>
2023-11-22 09:30:46,526:     from app import app as application  # noqa
2023-11-22 09:30:46,526: 
2023-11-22 09:30:46,526:   File "/home/stephen420/mysite/server/app.py", line 17, in <module>
2023-11-22 09:30:46,526:     db.init_app(app)
2023-11-22 09:30:46,527: 
2023-11-22 09:30:46,527:   File "/home/stephen420/.virtualenvs/venv/lib/python3.10/site-packages/flask_sqlalchemy/extension.py", line 355, in init_app
2023-11-22 09:30:46,527:     raise RuntimeError(
2023-11-22 09:30:46,527: ***************************************************
2023-11-22 09:30:46,527: If you're seeing an import error and don't know why,
2023-11-22 09:30:46,527: we have a dedicated help page to help you debug: 
2023-11-22 09:30:46,528: https://help.pythonanywhere.com/pages/DebuggingImportError/
2023-11-22 09:30:46,528: ***************************************************

[edit by admin: formatting, deleted old error messages]

It looks like you haven't set the SQLALCHEMY_DATABASE_URI property to tell Flask-SQLAlchemy where your database is located.