Guest User

Untitled

a guest
Jan 11th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Piece of my code:
  2.  
  3. @app.route('/register', methods=['GET', 'POST'])
  4. def register():
  5. form = RegisterForm(request.form)
  6. if request.method=='POST' and form.validate():
  7. name = form.name.data
  8. email = form.email.data
  9. username = form.username.data
  10. password = sha256_crypt.encrypt(str(form.password.data))
  11.  
  12. c.execute("INSERT INTO users(name,email,username,password)
  13. VALUES(?,?,?,?)", (name, email, username, password))
  14.  
  15. conn.commit
  16.  
  17. conn.close()
  18.  
  19. The error:
  20. File "C:Usersapp.py", line 59, in register c.execute("INSERT INTO users(name,email,username,password) VALUES(?,?,?,?)", (name, email, username, password))
  21. ProgrammingError: SQLite objects created in a thread can only be used in that
  22. same thread.The object was created in thread id 23508 and this is thread id
  23. 22640
Add Comment
Please, Sign In to add comment