def create_dummy_session(self): sess = SyncSession() sess.kiosk = self.a sess.client_ref = 'C' sess.client_ip = '222.222.222.222' sess.data_type = 'Sensor Data' sess.put() self.sess1 = sess
def get(self): upload_url = blobstore.create_upload_url('/api/upload') challenge = str(uuid1().get_hex()) self.response.headers['X-eko-challenge'] = challenge dieid = self.request.get('kiosk-id') kiosk = Kiosk.kiosk_from_dieid(dieid) # we create a sync session sess = SyncSession() sess.client_ref = challenge sess.client_ip = self.request.remote_addr sess.kiosk = kiosk sess.start_date = datetime.utcnow() sess.put() self.response.headers['client-ip'] = self.request.remote_addr self.response.write(upload_url) return