title: I get URL not found I use Flask render_template method
body: <p>I am writing an application which is managing forms using Flask as backend framework.</p>
  
  <p>When I fill data in the form(username and password) correctly, instead of the program returning <code>'Form sucessfully submitted'</code>, I get the following error:  </p>
  
  <p><strong>Not Found</strong></p>
  
  <p><strong>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</strong></p>
  
  <p>Why is that happening?</p>
  
  <p>Notice 1: I put a HTML file in templates directory, so that is not a cause of the error</p>
  
  <p>Notice 2: I wrote here only the code which is relevant to this problem</p>
  
  <p><strong>Here is the code:</strong></p>
  
  <p><strong>1) application.py</strong></p>
  
  <pre><code>from flask import Flask, render_template, redirect, url_for
  from flask_wtf import FlaskForm
  from wtforms import StringField, PasswordField
  from wtforms.validators import InputRequired, Email, Length, AnyOf
  from flask_bootstrap import Bootstrap
  
  app = Flask(__name__)
  
  Bootstrap(app)
  app.config['SECRET_KEY'] = 'somePassword'
  
  class LoginForm(FlaskForm):
      username = StringField('username', validators=[InputRequired(), Email(message='I don\'t like your email.')])
      password = PasswordField('password', validators=[InputRequired(), Length(min=5, max=10), AnyOf(['secret', 'password'])])
  
  @app.route('/login', methods=['GET', 'POST'])
  def login():
      form = LoginForm()
      if form.validate_on_submit():
          return 'Form sucessfully submitted'
      return render_template('loginForm1.html', form=form)
  
  if __name__ == '__main__':
      app.run(debug=True)
  </code></pre>
  
  <p><strong>2) loginForm1.html</strong></p>
  
  <pre><code>{% extends "bootstrap/base.html" %}
  {% import "bootstrap/wtf.html" as wtf %}
  
  {% block title %}
  WTForms
  {% endblock %}
  
  {% block content %}
  &lt;div class="container"&gt;
      &lt;form method="POST" action="/"&gt;
          &lt;dl&gt;
              {{ wtf.quick_form(form)}}
              &lt;input type="submit" value="Login" class="btn btn-info"&gt;
          &lt;/dl&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>