Open garywu520 opened 3 years ago
I think you need to upgrade flask-sqlalchemy lib. I fixed it.
I think you need to upgrade flask-sqlalchemy lib. I fixed it.
so...how to do??? "pip install -U Flask-SQLAlchemy"
just remove specific version from requirement.txt
flask==1.1.2 flask-sqlalchemy psycopg2-binary==2.8.5 pymysql==0.9.3 tomlkit==0.5.11
I am using flask-sqlalchemy==2.4.3
and the code to set database needs fixing... Seemingly this is a bug from flask_sqlalchemy
self._sa.apply_driver_hacks(self._app, sa_url, options)
File "/root/miniconda3/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 914, in apply_driver_hacks
sa_url.database = os.path.join(app.root_path, sa_url.database)
AttributeError: can't set attribute
So the best thing to do is to upgrade to a version without bug... I am currently using a patched requirements.txt like
flask==1.1.2
flask-sqlalchemy==2.5.1
psycopg2-binary==2.8.5
pymysql==0.9.3
tomlkit==0.5.11
itsdangerous==2.0.1
The account password is correct, it seems that the database is empty and cannot be logged in