Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P5. Models and Databases #5

Open
CisMarian opened this issue Jan 6, 2023 · 1 comment
Open

P5. Models and Databases #5

CisMarian opened this issue Jan 6, 2023 · 1 comment

Comments

@CisMarian
Copy link

CisMarian commented Jan 6, 2023

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants