def render_front(self): tm, blogposts = db_model.blogpost.get_blog_list() template_values = {'home_page': const_and_params.get_page_home(), 'blogposts': blogposts, 'top_link_login': const_and_params.get_page_login(), 'top_link_signup': const_and_params.get_page_signup(), 'seconds_ago': int(round(time.time() - tm))} self.render('blogfront.html', **template_values)
def get(self, blog_id): tm, post = db_model.blogpost.get_by_id(blog_id) if not post: self.error(404) return template_values = {'home_page': const_and_params.get_page_home(), 'blogposts': [post], 'top_link_login': const_and_params.get_page_login(), 'top_link_signup': const_and_params.get_page_signup(), 'seconds_ago': int(round(time.time() - tm))} self.render('blogfront.html', **template_values)
# -*- coding: utf-8 -*- import webapp2 from request_handlers.blog_main_page import BlogMainPage from request_handlers.newpost_main_page import NewpostMainPage from request_handlers.permalink_page import PermalinkPage from request_handlers.signup_page import SignupPage from request_handlers.welcome_page import WelcomePage from request_handlers.login_page import LoginPage from request_handlers.logout_page import LogoutPage import const_and_params app = webapp2.WSGIApplication([(const_and_params.get_page_home(), BlogMainPage), (const_and_params.get_page_new_post(), NewpostMainPage), (const_and_params.get_filter_post_permalink(), PermalinkPage), (const_and_params.get_page_signup(), SignupPage), (const_and_params.get_page_welcome(), WelcomePage), (const_and_params.get_page_login(), LoginPage), (const_and_params.get_page_logout(), LogoutPage)], debug=True) # http://joropi-hello-udacity.appspot.com/blog # http://joropi-hello-udacity.appspot.com/blog/signup # http://udacity-cs253.appspot.com/blog