title: not a valid sha512_crypt hash Python Flask Error
body: <p>Hey for some reasons I get this error <code>not a valid sha512_crypt hash</code>everytime I try to login on my login page. </p>
  
  <p>Piece of Register page:</p>
  
  <pre><code>                username = request.form['username']
                  password = sha512_crypt.encrypt((str(request.form['password'])))
                  email = request.form['email']
  
                  cur.execute("INSERT INTO users (name,password,email) VALUES (?,?,?)",(username,password,email)
  </code></pre>
  
  <p>Piece of my login Page:</p>
  
  <pre><code>data = cur.execute("SELECT password FROM users WHERE name= ?", (request.form['username'],))
  
                  data = cur.fetchone()[0]
  
                  if sha512_crypt.verify(request.form['password'], data):
                      session['logged_in'] = True
                      session
  
                    #etc #etc #etc
  </code></pre>
  
  <p>So when I fill in a username and password from my DB I get an error: 
  <code>not a valid sha512_crypt hash</code>
  In my DB there are encrypted passwords, so my sha256 encryption works theoretically.</p>