title: Appengine Users API: Redirect to create_login_url: 'NoneType' object has no attribute nickname
body: <p>I am very new to the App Engine. I want to create user login using the simple users api provided by the google.appengine.api.users module</p>
  
  <pre><code>  def get(self):
      user = users.get_current_user()
  
      if user:
          self.response.headers['Content-Type'] = 'text/html'
          logout = users.create_logout_url('/')
  
      else:
          self.redirect(users.create_login_url(self.request.uri))
          user = users.get_current_user()
          user_name = user.nickname()            
  </code></pre>
  
  <p>But it seems that redirection to the login url is not taking place. It shows the error 'NoneType' object has no attribute nickname</p>
  
  <p>What is the problem in my code? If I remove the user.nickname() call under the else clause it's working fine...</p>