title: I am writing a small app in bottle. I have some conceptual problem help me to solve it out
body: <pre><code>from bottle import  route, run, debug, error, request, template
  
  @route('/home')
  @route('/home/')
  def login():
      return template('templates/login')
  
  @route('/home', method='POST')
  @route('/home/', method='POST')
  def welocme():
      data = request.POST
      if data:
          password = data.get('password')
          check_pass = 'password'
          if password == check_pass:
              return template('templates/welcome')
          else:
              return template('templates/login')
      else:
          return template('templates/login')
  </code></pre>
  
  <p>My requirement is:
  I will get a login and welcome page on same url. Login page has only one password field.</p>
  
  <p>My problem:
  If I get login and go to welcome page again on refreshing, it send me to login page. But ideally it should be on the welcome page only.  </p>
  
  <pre><code>@error(404)
  def error404(error):
      return 'http://google.com'
  </code></pre>
  
  <p>My second problem: I want to redirect on a particular url on 404.</p>