title: ProgrammingError: SQLite objects created in a thread can only be used in that same thread
body: <p>i'm fairly new to programming. I've tried MySQL before, but now it's my first time using SQLite in a python flask website. 
      So maybe I'm using MySQL syntax instead of SQLite, but I can't seem to find the problem.</p>
  
  <pre><code>Piece of my code: 
  
  @app.route('/register', methods=['GET', 'POST'])
  def register():
      form = RegisterForm(request.form)
      if request.method=='POST' and form.validate():
          name =  form.name.data 
          email = form.email.data
          username = form.username.data
          password = sha256_crypt.encrypt(str(form.password.data))
  
          c.execute("INSERT INTO users(name,email,username,password) 
          VALUES(?,?,?,?)", (name, email, username, password))
  
          conn.commit
  
          conn.close()
  
  The error:
   File "C:\Users\app.py", line 59, in register c.execute("INSERT INTO users(name,email,username,password) VALUES(?,?,?,?)", (name, email, username, password))
   ProgrammingError: SQLite objects created in a thread can only be used in that 
   same thread.The object was created in thread id 23508 and this is thread id 
   22640
  </code></pre>
  
  <p>Does this mean I can't use the name, email username &amp; password in an HTML file?
  How do I solve this? </p>
  
  <p>Thank you.</p>