title: Custom routing in Flask app
body: <p>I've been trying to understand how to generate dynamic Flask URLs. I've read the docs and several example, but can't figure out why this code doesn't work:</p>
  
  <pre><code>path = 'foo'
  @app.route('/&lt;path:path&gt;', methods=['POST'])
  def index(path=None):
      # do some stuff...
      return flask.render_template('index.html', path=path)
  </code></pre>
  
  <p>I'd expect my index.html template to be served to <code>/foo</code>, but it is not. I get a build error. What am I missing?</p>
  
  <p>If I use a fixed path, like <code>/bar</code>, everything works without issue.</p>
  
  <p><code>@app.route('/bar', methods=['POST'])</code></p>