예제 #1
0
파일: page.py 프로젝트: niczy/Memegen
 def get(self, template_id = None):
     url = self.request.get('url')
     if url:
         #fetch the url then redirect to /makememe/tempalteid
         logging.info("got url is " + url)
         blob_key = meme.fetch_image_to_blobstore(url)
         meme.save_template(blob_key)
         redirect(self, '/makememe/%s' % blob_key)
         return
     render_page(self, 'make_meme', template_id=template_id)
예제 #2
0
파일: page.py 프로젝트: niczy/Memegen
 def post(self):
     blob_key = self.request.get('blob_key')
     top_caption = self.request.get('top_caption')
     bottom_caption = self.request.get('bottom_caption')
     style = self.request.get('style')
     fetch_url = self.request.get('fetch_url')
     if fetch_url:
         blob_key = meme.fetch_image_to_blobstore(fetch_url)
         meme.save_template(blob_key)
         self.response.out.write(blob_key) #TODO
     else:
         self.response.out.write(meme.make_meme(blob_key, top_caption, bottom_caption, style, self.uid)) #TODO