title: Flask Error: "Method Not Allowed The method is not allowed for the requested URL"
body: <p>I'm getting the following error whenever I try to submit data to my Flask form:</p>
  
  <pre><code>Method Not Allowed The method is not allowed for the requested URL.
  </code></pre>
  
  <p>I think the issue is in the <code>return redirect(url_for('database'))</code> I'm doing. I've also tried <code>return render_template('database.html)</code> too. I'm trying to call the database page once form entries have been submitted to the database. </p>
  
  <p>Relevant parts of my code are as follows:</p>
  
  <pre><code>@app.route('/entry', methods=['GET', 'POST'])
  def entry_page():
      if request.method == 'POST':
          date = request.form['date']
          title = request.form['blog_title']
          post = request.form['blog_main']
          post_entry = models.BlogPost(date = date, title = title, post = post)
          db.session.add(post_entry)
          db.session.commit()
          return redirect(url_for('database'))
      else:
          return render_template('entry.html')
  
  @app.route('/database')        
  def database():
      query = []
      for i in session.query(models.BlogPost):
          query.append((i.title, i.post, i.date))
      return render_template('database.html', query = query)
  </code></pre>
  
  <p>entry.html is...</p>
  
  <pre><code>THIS IS THE BLOG ENTRY PAGE
  
  blog:
  &lt;html&gt;
      &lt;form action='/database' method = "post"&gt;
          date&lt;input name = "date" type = "text" class="text"&gt;
          title&lt;input name = "blog_title" type = "text" class="text"&gt;
          main&lt;input name = "blog_main" type = "text" class="text"&gt;
          &lt;input type = "submit"&gt;
      &lt;/form&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>and database.html...</p>
  
  <pre><code>THIS IS THE QUERY:
  
  {{query}}
  </code></pre>