title: Flask dynamic route not working - Real Python
body: <p>I'm working through RealPython and I'm having trouble with the flask dynamic route.</p>
  
  <p>Everything seemed to work until the dynamic route. Now if I try to enter a "search query" (i.e. localhost:5000/test/hi) the page is not found. localhost:5000 still works fine.  </p>
  
  <pre><code># ---- Flask Hello World ---- #
  
  # import the Flask class from the flask module
  from flask import Flask
  
  # create the application object
  app = Flask(__name__)
  
  
  # use decorators to link the function to a url
  @app.route("/")
  @app.route("/hello")
  # define the view using a function, which returns a string
  def hello_world():
      return "Hello, World!"
  
  # start the development server using the run() method
  if __name__ == "__main__":
      app.run()
  
  
  # dynamic route
  @app.route("/test/&lt;search_query&gt;")
  def search(search_query):
      return search_query
  </code></pre>
  
  <p>I can't see that other people using RealPython have had an issue with the same code, so I'm not sure what I'm doing wrong. </p>