Flask - 405, Method not allowed
<p>I'm trying to send this simple form data to MySQL database using POST method. but same error "Method not allowed", I don't know what's wrong with that. Please help me out here. </p>

<p>HTML Codes:</p>

<pre><code>&lt;form role="form" action='/updateabbprof' method="POST"&gt;

          &lt;div class="form-group"&gt;
            &lt;label class="control-label"&gt;About Us&lt;/label&gt;
            &lt;textarea class="form-control"  name="updabt" id="editabt"&gt;&lt;/textarea&gt;
          &lt;/div&gt;

      &lt;div class="form-group"&gt;
        &lt;button id="aupdate" type="submit" class="btn btn-primary"&gt;Save&lt;/button&gt;
      &lt;/div&gt;
      &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>Flask:</p>

<pre><code>app.route('/updateabbprof', methods = ['POST'])
def updateaprof():
        try:

                if session.get('user'):
                    _userid = session.get('user')
                    _userabt = str(request.form['updabt'])


                    #if _userid or _username or _email or _phone:
                    con = mysql.connect()
                    cursor = con.cursor()
                    cursor.execute("""UPDATE user_signpp SET user_abt = %s WHERE Id =%s""",(_userabt,_userid))
                    con.commit()
                    cursor.close()
                    con.close()
                    con = mysql.connect()
                    cursor = con.cursor()
                    cursor.execute("""SELECT * FROM user_signpp WHERE Id = %s""",(_userid))
                    con.commit()
                    datanew = cursor.fetchall()
                    session['msg'] = list(datanew[0])
                    cursor.close()
                    con.close()
                    return redirect("/userprofile")
                else:
                    return redirect('/')
        except Exception as e:
                return render_template('error.html', error = str(e))
</code></pre>

<p>Userprofile route:</p>

<pre><code>@app.route('/userprofile', methods = ['GET','POST'])
def userprofile():
        try:
            if session.get('user'):

                        return render_template('profile.html', msg = session.get('msg'))
            else:
                        return redirect('/')
        except Exception as e:
            return render_template('error.html', error = str(e)) 
</code></pre>