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

  • SEARCH
  • Home
  • 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 8260767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:10:16+00:00 2026-06-08T03:10:16+00:00

I’ve created quite a beefy app. I have a profile page system implemented. Now,

  • 0

I’ve created quite a beefy app. I have a profile page system implemented. Now, I am a pretty big ‘noob’ when it comes to programming and app engine, so be gentle here, (please). So I know that you can pass parameters in to the url example, /profile/. I’m just not completely sure how to implement that into my code or the thought process behind it.

This would be my database:

class User(db.Model):
    name = db.StringProperty(required = True)
    pw_hash = db.StringProperty(required = True)
    email = db.StringProperty(required = True)

This is my profile handler:

class Profile(MainHandler):
    def get(self):
        if self.user:
            current_user = str(self.user.name)
            key='ag5kZXZ-c3VpdGVnYW1lcnINCxIHSW1hZ2VkYhglDA '
            imgs  = db.GqlQuery("select * from Imagedb WHERE name =:1", current_user)
            for img in imgs:
                key = img.key() # this is the key
            self.render('profile.html', profile_image = key ,username = self.user.name, email = self.user.email, first_name = self.user.first_name, last_name = self.user.last_name, country = self.user.country, prov_state = self.user.prov_state, city_town = self.user.city_town)
        else:
            self.redirect('/register')

The profile has a display picture system implemented at the moment as well. My goal here is to basically build what you would call a social network. AKA, blog on each profile, and a message system, along with some other systems.

I appreciate any and all help. Even if they are just your thoughts/opinions. I have my site up loadable to a domain, so it would be possible to show you, but I would really like to keep it under wraps until its done :P.

Thanks very much.

EDIT:

This is the solution I saw posted, however I not sure how to go about implementing it.

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),])
  • 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-08T03:10:17+00:00Added an answer on June 8, 2026 at 3:10 am

    You’re looking to make the profile_id part of the URL and you want that ID passed to your request handler. This change to your application definition is defining the mapping between ‘routes’ and RequestHandler objects:

    app = webapp2.WSGIApplication([('/', MainPage),
                                   ('/profile/<profile_id>', ProfilePage),])
    

    Typically these mappings are a URL or URL regex with some syntax/convention to identify variables.

    In this case '/profile/<profile_id>' is a route template that uses the name profile_id to match whatever is passed in the second path segment.

    Any matches are passed as positional arguments to your RequestHandler functions. This is handled by the framework, you just need to add arguments for each <name[:regex]> block in your route.

    The reason that the posted solution recommends adding a unique_identifier field to the User model is store the canonical user_id / profile_id. Say you just use an integer to represent the unique user identity.

    Your route template could be changed to only match integers, like '/profile/<user_id:\d+>/' and the url for a user would be something like /profile/1024/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.