title: Method Not Allowed - The method is not allowed for the requested URL
body: <p>I'm trying to build a python flask application, but I'm facing an issue when I try to submit form data to the python method.</p>
  
  <p>The issue that the server is throwing is "Method Not Allowed".</p>
  
  <blockquote>
    <p>HTML CODE</p>
  </blockquote>
  
  <pre><code>&lt;h1&gt;Submit the Link&lt;/h1&gt;
      &lt;form action="/submit_article" method="POST" name="form"&gt;
          &lt;div class="col-md-4 col-md-offset-4"&gt;
              {{ form.hidden_tag() }}
              &lt;div class="form-group"&gt;
                  &lt;label class="control-label" for="description"&gt;Name&lt;/label&gt;
                  {{ form.description }}
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label class="control-label" for="link"&gt;Link&lt;/label&gt;
                  {{ form.link }}
              &lt;/div&gt;
              &lt;button class="btn btn-default" type="submit"&gt;Submit&lt;/button&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <blockquote>
    <p>PYTHON METHOD (submit_article)</p>
  </blockquote>
  
  <pre><code>@app.route('/submit_article', methods=['POST'])
  def submit_article():
    form = UploadForm()
    if request.method == 'POST':
      data = {
          "_id": form.link.data,
          "description": form.description.data,
          "user": current_user.username,
          "time": datetime.datetime.now()
      }
  
      try:
          if((app.config['NEWS_COLLECTION'].insert(data))):
              flash("Link added successfully", category="success")
              return redirect(request.args.get("new") or url_for("new"))
  
      except DuplicateKeyError:
          flash("Article link already exists in the Database", category="error")
          return render_template("submit_article.html")
  
    return render_template('submit_article.html', title='login', form=form)
  </code></pre>