title: Flask does not recognize controller when using `url_for()` in HTML form
body: <p>When trying to implement a basic form I get the following error message: <code>werkzeug.routing.BuildError: Could not build url for endpoint 'finder.search'. Did you mean 'finder.static' instead?</code>, the <code>index.html</code> page does not even load because of this error.</p>
  <p><strong>Directory</strong></p>
  <pre><code>Steam
    SteamFinder
      static
        style.css
      templates
        index.html
        result.html
      __init__.py
      finder.py
    venv
  </code></pre>
  <p><strong><strong>init</strong>.py</strong></p>
  <pre class="lang-py prettyprint-override"><code>from flask import Flask
  from flask.templating import render_template
  
  
  def create_app():
      # create and configure the app
      app = Flask(__name__)
  
      from . import finder
      app.register_blueprint(finder.bp)
  
      @app.route(&quot;/&quot;)
      def home():
          return render_template(&quot;index.html&quot;)
  
      return app
  
  </code></pre>
  <p><strong>finder.py</strong></p>
  <pre class="lang-py prettyprint-override"><code>from flask import Blueprint, request
  from flask.templating import render_template
  
  bp = Blueprint(&quot;finder&quot;, __name__, template_folder=&quot;templates&quot;, static_folder=&quot;static&quot;)
  
  bp.route(&quot;/search&quot;, methods=[&quot;POST&quot;])
  def search():
      query = request.form[&quot;query&quot;]
      print(query)
      return render_template(&quot;result.html&quot;)
  
  </code></pre>
  <p><strong>index.html</strong></p>
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
      &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../static/style.css&quot;/&gt;
      &lt;title&gt;Home&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;form action=&quot;{{ url_for('finder.search') }}&quot; method=&quot;post&quot;&gt;
          &lt;label for=&quot;query&quot;&gt;Query:&lt;/label&gt;&lt;br&gt;
          &lt;input type=&quot;text&quot; id=&quot;query&quot; name=&quot;query&quot;&gt;&lt;br&gt;
          &lt;input type=&quot;submit&quot;&gt;
      &lt;/form&gt;
      
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>