title: Tornado URL query parameters
body: <p>I've been playing around with Tornado, and I've written some code that doesn't seem very nice.</p>
  
  <p>I'm writing an app to store recipes as an example. These are my handlers:</p>
  
  <pre><code>handlers = [
      (r"/recipes/", RecipeHandler),
      (r"/recipes", RecipeSearchHandler), #so query params can be used to search
  ]
  </code></pre>
  
  <p>This lead me to writing this:</p>
  
  <pre><code>class RecipeHandler(RequestHandler):      
      def get(self):
          self.render('recipes/index.html')
  
  class RecipeSearchHandler(RequestHandler):    
      def get(self):
          try:
              name = self.get_argument('name', True)
              self.write(name)
          # will do some searching
          except AssertionError:
              self.write("no params")
              # will probably redirect to /recipes/
  </code></pre>
  
  <p>Is there a better way to approach these URLs without a try/except? I'd like /recipes and /recipes/ to show the same thing, whereas /recipes?name=something would do a search, and ideally be a different handler.</p>