jimdevops19 / FlaskSeries

This is the Code from my Flask Series - JimShapedCoding. Each Folder is a checkpoint where we stopped at that particular episode number
368 stars 280 forks source link

P5. Models and Databases #5

Open CisMarian opened 1 year ago

CisMarian commented 1 year ago

I have this problem with "@app.route('/market') def market_page(): items = Item.query.all() <----------- return render_template('market.html', items=items)"

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: item [SQL: SELECT item.id AS item_id, item.name AS item_name, item.price AS item_price, item.barcode AS item_barcode, item.description AS item_description FROM item] (Background on this error at: https://sqlalche.me/e/14/e3q8

Please help

abhi-shek-09 commented 1 year ago

This can be one of two things 1) you haven't configured your database connection settings properly in your Flask application. You can check this by looking at your app.config object to ensure that the URI for your database is properly set. 2) Check your database, when I had this issue, I accidentally cleared my database, maybe your database is empty too image