def home(request): # session = sessions.Session(request) # if session.do_redirect(): return template_values = {} pastes = Paste.get_most_recent_public() template_values.update({"explain": True, "formats": formatting.formats_ordered, "pastes": pastes}) return render_to_response("index.html", template_values)
def get(self): self.init_session() if self.do_redirect(): return user = self.get_key('user') #pastes_query = Paste.gql("WHERE owner=:owner ORDER BY date_created DESC", # owner=user) #pastes = pastes_query.fetch(10) pastes = Paste.get_most_recent_public().fetch(10) self.template_values.update({ 'explain': True, 'formats': formatting.formats_ordered, 'pastes': pastes }) path = get_template_path('index.html') self.response.out.write(template.render(path, self.template_values, debug=True))