You could store the url in the datastore (after updating your model
definion to include the field :)
....
> frasi.gruppo = self.request.get('domain')
> frasi.link = blob_info.key()
frasi.servinglink = images.get_serving_url(frasi.link, 32)
> frasi.put()
.....
Then would just in the template
<img src="{{ elemento.servinglink }}" width="10%"/><br></a>
... or you could call get_serving_url in the code that renders the
template. You don't need a 'Serve' handler at all :)
On 27 October 2010 22:22, Massimiliano <[email protected]> wrote:
> I do understand this, but my html is:
> <img src="/serve/{{ elemento.link }}" width="10%"/><br></a>
> How have I to modify the html?
> I tried with an Iframe, but doesn't work.
> class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
> def post(self):
> upload_files = self.get_uploads('File')
> blob_info = upload_files[0]
> self.request.get('Nick')
> frasi = FRASI()
> frasi.frase = self.request.get('Frase')
> frasi.gruppo = self.request.get('domain')
> frasi.link = blob_info.key()
> frasi.put()
> self.redirect("/" + self.request.get('domain') + "/fanpage")
> class ServeHandler(webapp.RequestHandler):
> def get(self, resource):
> self.response.headers['Content-Type'] = "image/png"
> self.response.out.write(images.get_serving_url(resource, 32))
> 2010/10/27 Barry Hunter <[email protected]>
>>
>> get_serving_url is a URL to the file directly - you use it in the
>> actual image tag.
>>
>> self.response.out.write('<img src="%s"/>'%images.get_serving_url(resource,
>> 32))
>>
>>
>>
>> On 27 October 2010 19:28, Massimiliano <[email protected]>
>> wrote:
>> > I'm trying to serve the images with this code, but it's not working
>> > class ServeHandler(webapp.RequestHandler):
>> > def get(self, resource):
>> > self.response.headers['Content-Type'] = "image/png"
>> > self.response.out.write(images.get_serving_url(resource, 32))
>> > Could you help me?
>> > 2010/10/27 Massimiliano <[email protected]>
>> >>
>> >> I have understand very well the Stephen solution. I'm just fighting
>> >> with
>> >> the serve part of the code...
>> >>
>> >> 2010/10/27 ego008 <[email protected]>
>> >>>
>> >>> you can do it step by step here
>> >>>
>> >>>
>> >>> http://code.google.com/intl/en/appengine/docs/python/images/usingimages.html
>> >>>
>> >>> GAE Geek http://gaefons.appspot.com/
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups
>> >>> "Google App Engine" group.
>> >>> To post to this group, send email to
>> >>> [email protected].
>> >>> To unsubscribe from this group, send email to
>> >>> [email protected].
>> >>> For more options, visit this group at
>> >>> http://groups.google.com/group/google-appengine?hl=en.
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> My email: [email protected]
>> >> My Google Wave: [email protected]
>> >
>> >
>> >
>> > --
>> >
>> > My email: [email protected]
>> > My Google Wave: [email protected]
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Google App Engine" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group at
>> > http://groups.google.com/group/google-appengine?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>
>
>
> --
>
> My email: [email protected]
> My Google Wave: [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.