def respond(self, rh): for hdr in self.headers: rh.response.headers[hdr] = self.headers[hdr] rh.response.headers["X-Memcached-From"] = str(self.creation_date) if _ENABLE_CACHE_CONTROL_: rh.response.headers["Cache-Control"] = \ "max-age=%d, public" % (_CACHE_LIFE_) head = False rh.response.out.write(self.content) if self.status_code != 200: rh.error(self.status_code) if self.analytics_tag: enqueue_log_task(rh, pagename=self.analytics_tag, from_memcache=True)
def get(self): template_file=os.path.join("templates", "piano.html") self.response.out.write(template.render(template_file, content.dict_for_django_template(self))) offline.enqueue_log_task(self, "piano")