So your Flask code doesn’t work, eh?

This flask project is ginormous. And you need a fresh start.

Make a new folder, and open in in VS Code.

In the terminal

git clone https://github.com/lawilmoth/Learning-Flask.git

Move to the current chapter.

Delete venv.

Delete the databases.

python3 -m venv venv

source venv/bin/activate

pip install -r requirements.txt

Almost there. Keep going.

flask db upgrade

flask shell
>>> from my_app import db, User, Role
>>> db.create_all()
>>> u = User(username="me", email="me@example.com", password="cat")
>>> db.session.add(u)
>>> db.session.commit()

Yay. It finally works.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top