title: Error when retrieving URL path in GAE + python + Flask
body: <p>I'm trying to retrieve the URL of my app in GAE + python + flask and get the following error when I run it locally:</p>
  <pre><code>NameError: name 'self' is not defined
  </code></pre>
  <p>Here's the snippet of code I'm utilizing to retrieve the URL path and display it.</p>
  <pre><code>import Flask, session, etc etc
  
  ... 
  
  @app.route('/')
  def main():
      if 'username' in session:
          message = self.request.path 
          return render_template('main.html', username=session['username'], message=message) 
  
      return redirect(url_for('login'))
  </code></pre>
  <p>When I run the app locally on my Ubuntu machine I get the NameError copied above. I've searched in StackOverflow and some posts mention that 'self' should be invoked inside a method to exist. I'm invoking 'self' inside def main (), so I expect it to work but doesn't. It looks like I'm missing something about the scope of 'self'.</p>
  <p>Any ideas what's wrong? Once this works I'll upload it to GAE in the cloud.</p>
  <p>Thanks!</p>