2/16/2023 0 Comments Flask app builder no such columnThe problem is in your create_user function that you haven’t showed. Any and all insight would be greatly appreciated. When i manually execute the sql, everything works correctly, but when clicking the submit button I get the error. As you can see, the email column does exist, the email input value is labeled as email, and is passed as the variable: email. Last TEXT, email TEXT UNIQUE, password TEXT)Īnd there is data in that table (including email values). Plus, the users table was created with the following logic: CREATE_TABLE_USERS_SQL = """ĬREATE TABLE users(id INTEGER PRIMARY KEY AUTOINCREMENT, username TEXT UNIQUE, first TEXT, Usernames = cursor.execute(CHECK_USER_SQL, (username,)).fetchall() Return create_user(username, first, last, email, password)Įmails = cursor.execute(CHECK_EMAIL_SQL, (email,)).fetchall() SELECT username FROM users WHERE username = ?ĭef add_user(username, first, last, email, password): The db_mgmt module's logic that is used above: DB_NAME = 'test.db' Return redirect(url_for('signup', message = result)) Result = db_mgmt.add_user(username, first, last, email, password) This is my app/routing logic for the view in question: methods=) This is the html for the form in question: The only problem is that the email column does exist. The only problem is that when I click the submit button and it routes to the validate page that queries the database to ensure that the username or email doesn't already exist, I receive the following error: sqlite3.OperationalError: no such column: email At this point, I have a registration page with form that collects: -username I am learning Flask by trying to build a blog.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |