I am trying to upload a image and then redirect to another page when submit button is hit. But when i use back button in the browser and again upload the image, i get a 404 Not Found The resource could not be found. No such upload session
I have searched everywhere to resolve this issue but could not find any working any solution. Here is my code:
class PhotoUploadHandler(blobstore_handlers.BlobstoreUploadHandler):
    def post(self):
        try:
            upload = self.get_uploads()[0]
            user_photo = Image(blob_key=upload.key())
            user_photo.put()
            self.redirect('/view_photo/%s' % upload.key())
        except:
            self.error(500)
class ViewPhotoHandler(Handler, blobstore_handlers.BlobstoreDownloadHandler):
    def get(self, photo_key):
        if not blobstore.get(photo_key):
            self.error(404)
        else:
            image = images.get_serving_url(photo_key, size=None, crop=False, secure_url=None, filename=None, rpc=None)
            self.render('edit.html', image_key=image)
class MainHandler(Handler):
    def get(self):
        upload_url = blobstore.create_upload_url('/upload_photo')
        params = {'upload_url': upload_url,}
        self.render('imagify.html', **params)
The only way i could upload a image after going back is by reloading that page. What is the method of doing this without manually reloading the page? After looking everywhere it looks like it is a issue with blobstore. Please help.
 
     
     
    