How to upload file in django google app engine?

前端 未结 2 1771
旧时难觅i
旧时难觅i 2021-01-07 14:07

I am new to Google App Engine. I have deploy the pure django application in google app engine. It is working fine. But I wrote the django file upload functionality as shown

2条回答
  •  我在风中等你
    2021-01-07 15:00

    The best way to upload files in google app engine with python is using the blobstorehandler.

    class Upload(blobstore_handlers.BlobstoreUploadHandler):
    
        for upload in self.get_uploads():
            try:
                img = Image()
                img.primary_image = upload.key()
                img.put()
            except:
                pass
    

提交回复
热议问题