title: create unique profile page for each user python
body: <p>I am using google app engine in python with a Jinja2 template engine.</p>
  
  <p>This may be a silly solution but I have a list of a few thousand users and right now they can only access their own profile pages and have to be logged in to do it.  I would like to give every user a unique URL for their profile page and I am wondering how to do it.  I am not sure if this would work but could something like this be feasible?</p>
  
  <pre><code>class ProfilePage
      userlist = GQL query to return all users in the system
      user = users.get_by_id()
      for user in userlist:
          id = user.federated_id
  
          posts = GQL query to return all posts by that user
  
          self.render('/profile/id', posts=posts)
  
  app = webapp2.WSGIApplication([('/', MainPage),
                                 ('/profile/([0-9]+)', ProfilePage),])
  </code></pre>
  
  <p>My HTML for the profile page just displays the user's name and then displays all of their recent posts.</p>
  
  <p>Update:</p>
  
  <p>So here is my current code but I am just getting a 404 error:</p>
  
  <pre><code>class ProfilePage(webapp2.RequestHandler):
    def get(self, profile_id):
      user = User.get_by_id(profile_id)
      #profile_id = some unique field
      if user:
         #Get all posts for that user and render....
         theid = user.theid
         personalposts = db.GqlQuery("select * from Post where theid =:1 order by created desc limit 30", theid)
      else:
          personalposts = None
      global visits
      logout = users.create_logout_url(self.request.uri)
      currentuser = users.get_current_user()
      self.render('profile.html', user = currentuser, visits = visits, logout=logout, personalposts=personalposts)
  </code></pre>
  
  <p>How can I test it out I tried just entering www.url.com/profile/https://www.google.com/accounts/o8/id?id=AItOawlILoSKGNwU5RuTiRtXug1l8raLEv5-mZg</p>
  
  <p>Update:
  The ID I was retrieving was not their OpenID URL but rather a app specific id that each user is given and thus that is the correct  to use</p>