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 8184471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:30:52+00:00 2026-06-07T01:30:52+00:00

I asked a similar question here: create permenant unique links based on a user

  • 0

I asked a similar question here: create permenant unique links based on a user ID but couldn’t quite get an answer. I am trying to give every user on my site a unique profile page. I have it mostly set up but I keep getting a 404 error. Now I am not sure if it is a problem with my handler or just the whole way I am doing it.

Here is my app code:

app = webapp2.WSGIApplication([('/', MainPage),
                               (r'/profile/(.+)', ProfilePage)])

and here is my ProfilePage handler class:

class ProfilePage(webapp2.RequestHandler):
    def get(self, profile_id):
        profileowner = User.get_by_id(profile_id)

        if profileowner:
            #Get all posts for that user and render....
            #theid is their federated_id 
            theid = profileowner.theid
            personalposts = db.GqlQuery("select * from Post where theid =:1 order by created desc limit 30", theid)

            #I collect this so that I can have their username in the top of the page
            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)
        else:
            self.redirect("/")

For an ID of 1201, which I found in the datastore viewer for a use, I have been testing it by typing in http://www.url.com/profile/1201 and that is when I get the 404 error.

Update:
It now is redirecting me to the main page with Amber’s suggested change.

Now when I change this line:

profileowner = User.get_by_id(profile_id)

to this:

profileowner = User.get_by_id(17001)

it goes through correctly so I am guessing that that line is not correctly getting the profile_id from the URL

  • 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-07T01:30:54+00:00Added an answer on June 7, 2026 at 1:30 am
    r'/profile/<profile_id>'
    

    is not a valid regular expression. You probably want something like this instead:

    r'/profile/(.+)'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A similar question was asked here but without a satisfying answer. I'm trying to
I already asked similar question here, but I still get some errors, so I
I asked a very similar question here but since it is such a fundamental
I asked a similar question here a while back but all the answers were
I asked a similar question over here:( Upload clocking script ), but then changed
I found this on Google, click here , which someone asked a similar question,
A similar question was asked here: PHP variable like $myvar-test is not valid? And
A similar question was asked here Serving images from outside of document root The
I saw a similar question asked and answered for ASP.net here How do I
There are two similar questions asked here and here but no adequate answers are

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.