title: Why do i keep getting "TypeError: string indices must be integers" in my script?
body: <p>I am building a user flask application using MySQL and in the user login code i get the error TypeError: string indices must be integers every time. </p>
  
  <pre><code>@app.route('/signin',methods=['GET','POST'])
  def signin():
      if request.method == 'POST':
          email = request.method['email']
          password_entered = request.method['password']
          cur = mysql.connection.cursor()
          user = cur.execute("SELECT * FROM users WHERE email = %s",(email))
          if user &gt; 0:
              data = cur.fetchone()
              real_password = data['password']
              name = data['name']
              email = data['email']
              if pbkdf2_sha256.verify(password_entered,real_password):
                  session['logged_in'] = True
                  session['name'] = name
                  session['email'] = email
                  flash('Sign In Successful!',category='info')
                  return redirect(url_for('index'))
              else:
                  flash('Details Incorrect!Please try again.',category='error')
                  return render_template('signin.html')
          else:
              flash('User does not exist!Please Register.',category='error')
              return redirect(url_for('signup'))
  
      return render_template('signin.html')
  </code></pre>
  
  <p>Python shows that the error is from the line <code>email = request.method['email']</code>. Please assist.</p>