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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:51:13+00:00 2026-06-15T01:51:13+00:00

Firstly, I realize this is a fairly common question on here, and I have

  • 0

Firstly, I realize this is a fairly common question on here, and I have looked at numerous other similar StackOverflow questions, and none of the answers have solved the problem.

Basically, once users submit images -> they are posted as blank images – and when I click the src of the images I am lead to a blank page. What’s wrong with my code?

Here’s a mashup of bits and pieces of my code from various files

<div class="card-image"><img src="/image?img_id={{card.key()}}"></img>

class Card(db.Model):
    image = db.BlobProperty(required = True)

class Image(MainHandler):
    def get(self):
        card = db.get(self.request.get('img_id'))
        if card.image:
            self.response.headers['Content-Type'] = 'image/png'
            self.response.out.write(card.image)
        else:
            self.response.out.write('No image')
 class Gallery(MainHandler):
       image = db.Blob(images.resize(self.request.get('image'), 32, 32))
       #later in the code, a Card is constructed.
  • 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-15T01:51:14+00:00Added an answer on June 15, 2026 at 1:51 am

    Your code looks fine to me. Are you sure your model contains the image data?

    Second. There is a better, faster and cheaper way you can serve your images. Google can serve the images for you, almost for FREE and with runtime sizing, using App Engine’s High-Performance Image Serving System. To use this, you have to use the blobstore and use get_serving_url.

    Here is an example of a serving url:

    https://lh6.ggpht.com/1HjICy6ju1e2GIg83L0qdliUBmPHUgKV8FP3QGK8Qf2pHVBfwkpO_V38ifAPm-9m20q_3ueZzdRCYQNyDE3pmA695iaLunjE=s0

    UPDATE

    If you are new to the blobstore, my advise is to start uploading and serving images from the blobstore. See the code examples in the doc.

    After this works, you can optimize and use get_serving_url. You only have to get this serving url once and save in the datastore, so you can use in in your html img tag.

    Here is a code example to get a serving url for a blobstore blob, where the blob reference is saved in the datastore:

    class Dynamic(db.Model):                                                                        # key : name
        name = db.StringProperty() 
        blob_ref = blobstore.BlobReferenceProperty()
        serving_url = db.LinkProperty()
    
    dyn= Dynamic.get_by_key_name(key_name)
    try :                                                                               # get url with size = 0, do not save it
        dyn.serving_url = images.get_serving_url(dyn.blob_ref, size=None, secure_url=True)
    except DeadlineExceededError : 
        try :             # sometimes this request fails, retry. This always works fine
            dyn.serving_url = images.get_serving_url(dyn.blob_ref, size=None, secure_url=True)
        except DeadlineExceededError :
            logging.error('Image API get_serving_url deadline error after retry' %(dyn.key().name()))                        
                    return None
        dyn.put()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I realize there have been a few other questions on this topic, and the
Firstly sorry if this is a common question but I couldn't find anything on
Firstly, I realise that this is a very similar question to this one: Which
Firstly my maths is limited, so this question may have a simple answer. So,
Firstly, very sorry if this is not a true stackoverflow question. But it's something
Firstly, I know this [type of] question is frequently asked, so let me preface
Firstly I realise that this is a familiar question, it seems to pop up
Firstly, I have migrated my CVS repository into SVN repository. I checked out this
Firstly, thanks for taking the time to read and possibly comment on this question.
Firstly I have tried to re create this within a JSfiddle but unable to,

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.