def get(self, key):
     test = db.get(key)
     if str(test.kind()).__eq__("RealmKeys"):
         realm = test
         if not realm:
             self.error(404)
         newupload = UploadRequestKeys()
         newupload.realm_key = realm
         newupload.put()
         result = dict(type="blob", upload_url=str(self.request.url).replace(key, str(newupload.key())))
         json = simplejson.JSONEncoder().encode(result)
         self.response.headers["Content-Type"] = "application/json"
         self.response.out.write(json)
     elif str(test.kind()).__eq__("UploadRequestKeys"):
         url = self.request.url
         context = {"type": "blob", "url": url}
         path = os.path.join(os.path.dirname(__file__), "templates", "upload_form.html")
         # render the template with the provided context
         self.response.out.write(template.render(path, context))