title: Python Bottle.py decorator confusion
body: <p>i have a decorator named "auth" </p>
  
  <pre><code>def auth(check_func=validate_login):
      def decorator(view):
          def wrapper(*args, **kwargs):
              auth = check_func()
              if auth:
                  return view(*args, **kwargs)
              return bottle.redirect('/login.html')
          return wrapper
      return decorator
  </code></pre>
  
  <p>the <code>auth</code> decorator is used like this</p>
  
  <pre><code>@get('/')
  @view("someview")
  @auth()
  def handler():
     #myhandlercode
  </code></pre>
  
  <p>so the <code>auth</code> decorator calls the <code>view</code> function which renders my template in bottle.py.
  But now i want to return json instead of rendering a <code>view</code>. So what changes do i have to make to the <code>auth</code> decorator code to make this happen? I am confused as to how to call the handler instead of the <code>view</code> from the auth code.</p>
  
  <p>EDIT 1 : Bottle allows you to return dict, it directly converts it to json. And i dont want to use the view at all, i just want to return json to the user from my handlers.  So should i just remove the @view decorator? and what should i call instead in the auth decorator?</p>