techwithtim / Flask-Web-App-Tutorial

Code for the note storing flask web app made during a YouTube video.
940 stars 1.03k forks source link

Help me out on this error #11

Open infawikirich opened 3 years ago

infawikirich commented 3 years ago

C:\Users\CBAS\AppData\Local\Programs\Python\Python37\lib\site-packages\flask_sqlalchemy__init.py:834: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning. 'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and ' Traceback (most recent call last): File "C:/Users/CBAS/Documents/Python Scripts/Pycharm/Tech with Tim/main.py", line 9, in app = create_app() File "C:\Users\CBAS\Documents\Python Scripts\Pycharm\Tech with Tim\website__init.py", line 27, in create_app create_database(app) File "C:\Users\CBAS\Documents\Python Scripts\Pycharm\Tech with Tim\website__init.py", line 38, in create_database db.create_all(app=app) File "C:\Users\CBAS\AppData\Local\Programs\Python\Python37\lib\site-packages\flask_sqlalchemy__init__.py", line 1039, in create_all self._execute_for_all_tables(app, bind, 'create_all') File "C:\Users\CBAS\AppData\Local\Programs\Python\Python37\lib\site-packages\flask_sqlalchemy\init.py", line 1031, in _execute_for_all_tables op(bind=self.get_engine(app, bind), **extra) File "C:\Users\CBAS\AppData\Local\Programs\Python\Python37\lib\site-packages\flask_sqlalchemy\init__.py", line 962, in get_engine return connector.get_engine() File "C:\Users\CBAS\AppData\Local\Programs\Python\Python37\lib\site-packages\flask_sqlalchemy\init.py", line 555, in get_engine options = self.get_options(sa_url, echo) File "C:\Users\CBAS\AppData\Local\Programs\Python\Python37\lib\site-packages\flask_sqlalchemy\init__.py", line 570, in get_options self._sa.apply_driver_hacks(self._app, sa_url, options) File "C:\Users\CBAS\AppData\Local\Programs\Python\Python37\lib\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

rustedorc commented 3 years ago

^^^ i have this exact same issue its something to do with the 'db.create_all(app=app)' but im not sure what

EDIT: found the issue, you have to downgrade your SQLAlchemy type: pip install upgrade SQLAlchemy==1.3.6 in cmd

pvr30 commented 3 years ago

SQLALCHEMY_TRACK_MODIFICATIONS = False

Add this in your init.py file to resolve this warning

Abdoulshehu commented 3 years ago

Check_password_hash is not working