Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8142487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:50:07+00:00 2026-06-06T12:50:07+00:00

I am using google app engine in python with a Jinja2 template engine. This

  • 0

I am using google app engine in python with a Jinja2 template engine.

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?

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),])

My HTML for the profile page just displays the user’s name and then displays all of their recent posts.

Update:

So here is my current code but I am just getting a 404 error:

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)

How can I test it out I tried just entering http://www.url.com/profile/https://www.google.com/accounts/o8/id?id=AItOawlILoSKGNwU5RuTiRtXug1l8raLEv5-mZg

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:50:09+00:00Added an answer on June 6, 2026 at 12:50 pm

    An easy way to do this would be to assign a unique URL identifier to each user (or use their key name), that way you can query the user by their ID or do a query based on a unique URL identifier property. You can also use their federated_id if you wanted.

    Example:

    class User(ndb.Model):
      unique_identifier = ndb.StringProperty()
      ...
    
    class ProfilePage(webapp2.RequestHandler):
      def get(self, profile_id):
        #profile_id = key name of user
        user = User.get_by_id(profile_id)
        #profile_id = some unique field
        #user = User.query(User.unique_identifier == profile_id).get()
        if user:
           #Get all posts for that user and render....
    
    
    app = webapp2.WSGIApplication([('/', MainPage),
                                   ('/profile/<profile_id>', ProfilePage),])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with using template in Google App Engine by Python. the thing
I'm using the latest version of Google App Engine, Python 2.7 and webapp2, but
i have made an application using python and google app engine, the app works
I am developing an application on the Google App Engine using Python. I have
I have created a simple python web site using Google App Engine. Currently, the
I'm using python google app engine with the webapp framework, substituting jinja2 templates for
I am using Google App Engine in Python. In My database, I have some
I have started using Jinja2 as my templating engine on Google App Engine (in
I'm using google app engine/python. And I have created a custom datatype and property.
Using Google App Engine and GQL and Python: in my datastore I have something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.