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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:42:33+00:00 2026-06-08T07:42:33+00:00

Ok, first I want to state that this is Google App Engine via Python.

  • 0

Ok, first I want to state that this is Google App Engine via Python.

Any who,

These are my handlers / routing where the problem is occuring. Please read below for context and specifics:

class GetImage(MainHandler):
    def get(self):
        img = db.get(self.request.get("entity_id"))
        self.response.out.write(img.image)

class Profile(MainHandler):
    def get(self, profile_name):
        current_user = str(self.user.name)
        profile_name = current_user
        if self.user:
            key='ag5kZXZ-c3VpdGVnYW1lcnINCxIHSW1hZ2VkYhgxDA'
            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_name = self.user.name, current_user = self.user.name, 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')

class Change_Profile_Image(MainHandler):
    def get(self):
        if self.user:
            self.render('change_profile_image.html', username = self.user.name, firstname=self.user.first_name, current_user = self.user.name)
        else:
            self.render('change_profile_image.html')

    def post(self):
        imagedb = Imagedb(name = self.user.name)
        imageupl = images.resize(self.request.get("img"), 200, 200)
        imagedb.image = db.Blob(imageupl)
        imagedb.put()
        self.redirect('/profile/'+self.user.name)


app = webapp2.WSGIApplication([('/', MainPage),
                               ('/register', Register),
                               ('/article', ArticlePage),
                               ('/profile/([^/]+)', Profile),
                               ('/login', Login),
                               ('/logout', Logout),
                               ('/welcome', Unit3Welcome),
                   ('/games', Games),
                   ('/forum', Forum),
                   ('/media', Media),
                   ('/rank', Rank),
                   ('/review', Reviews),
                   ('/events', Events),
                               ('/alreadyloggedin', AlreadyLoggedIn),
                   ('/change_profile_image', Change_Profile_Image),
                               ('/img', GetImage)],
                              debug=True)

Alright so here is where stuff gets loopy. If I change the Profile class to take — get(self) and remove my reg expression from the routing for the profile class, my images work perfectly. As soon as I route to unique profiles, i.e. pass profile_name into the Profile handler and map the URL to that profile, I lose all functionality of my GetImage handler. When I look at the source code, nothing has changed. The image is still being passed into the template as per usual.

Does anyone have any idea as to what is going on here? I would really appreciate it. Thank you very much in advance. Hopefully my knowledge will catch up to you guys and I’ll be answering questions soon :p.

  • 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-08T07:42:34+00:00Added an answer on June 8, 2026 at 7:42 am

    It’s difficult to answer your question without seeing a (simplified) version of your template.

    There are also a couple of weird elements in your code that make it hard to tell what’s going on. It’s hard to format this as a comment, so I’m putting it as an answer, just so you can at least see it.

    • In your get request in your profile handler, you try to get the current user before you check that the current user exists. You also just throw away the profile_name element completely when you assign profile_name to current_user, so you’ll never get a profile image for anything but the current user on a profile page.

    You take in profile_name here, but never use it:

       def get(self, profile_name):
            current_user = str(self.user.name)
            profile_name = current_user
    
    • You loop over imgs but replace the key each time, which means that if you return more than 1 image you can’t tell that this has occurred and you overwrite anything but the last image in the query. One thing you should do is add a check to see if imgs is even truthy, so you can tell if you got any results whatsoever, that might (though I can’t imagine how) explain why your image handler is failing.

    Finally, you might check your source to see which image url is actually being requested in the template.

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

Sidebar

Related Questions

I'm new here, just found these forums on Google. First of all, I want
I'm attempting my first google app engine project – a simple player stats database
First of all I want to state that I've just started with Drupal so
Let me first state that I know next to nothing about LDAP and this
First I want to clearify that I mean by reverse engineering something like decompiling
At first I want to say: I couldn't find a support forum for this
I am trying to do this with MVC 3 EF Model first I want
First thing i want to say that it's not an easy question to explain,
Alright, I am going to state up front that this question may be too
Ok first off let me state that I am new to PHP. So What

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.