Sorry, now It's working.

2011/4/25 Massimiliano <[email protected]>

> Hi, Can some one help me?
>
> *I have this error: *
>
>   File "/base/data/home/apps/maxfotoservice/1.349974609984865274/main.py", 
> line 28, in post
>     fotos.Tlink = images.get_serving_url(fotos.link, 94)
> NameError: global name 'images' is not defined
>
> *This is my code:*
>
> from google.appengine.ext import webapp
> from google.appengine.ext import blobstore
> from google.appengine.api import images
> from google.appengine.ext.webapp import blobstore_handlers
> from google.appengine.ext.webapp import template
> from google.appengine.ext import db
> from google.appengine.ext.webapp.util import run_wsgi_app
> from google.appengine.api import urlfetch
> import os
> import urllib
> import wsgiref.handlers
> import string
>
>
> class FOTO(db.Expando):
>       date = db.DateTimeProperty(auto_now_add=True)
>
> class MainHandler(webapp.RequestHandler):
>       def get(self):
>               upurl = blobstore.create_upload_url('/upload')
>               foto = FOTO.all()
>               foto.order("-date")
>               
> self.response.out.write(template.render('main.html',{'upurl':upurl, 
> 'foto':foto}))
>
> class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):
>       def post(self):
>               upload_files = self.get_uploads('File')
>               blob_info = upload_files[0]
>               fotos = FOTO()
>               fotos.link = blob_info.key()
>               fotos.Tlink = images.get_serving_url(fotos.link, 94)
>               fotos.Glink = images.get_serving_url(fotos.link, 400)
>               fotos.put()
>               self.redirect("/")
>
> def main():
>       application = webapp.WSGIApplication([
>               ('/upload', UploadHandler),
>               ('/.*', MainHandler)],
>               debug=True)
>       wsgiref.handlers.CGIHandler().run(application)
>
> if __name__ == '__main__':
>               main()
>
>
> --
> www.themaxbuddies.com <http://goo.gl/WoxEN>
>
>
>


-- 
www.themaxbuddies.com <http://goo.gl/WoxEN>

-- 
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.

Reply via email to