예제 #1
0
파일: views.py 프로젝트: TheWaWaR/blog
def post(name):
    ''' Some post '''

    post = POSTS.get(name, None)
    if post is None:
        abort(404)

    return render_template('post.html', post=post)
예제 #2
0
파일: views.py 프로젝트: TheWaWaR/blog
def rebuild():
    PAGES.clear()
    POSTS.clear()
    CATEGORIES.clear()
    init_pages_posts(current_app.root_path)
    return '<pre>{}</pre> <hr/> <a href="/">Home</a>'.format('<br />'.join(POSTS.keys()))
예제 #3
0
파일: views.py 프로젝트: TheWaWaR/blog
def home():
    ''' Home '''
    return render_template('home.html',
                           pages=PAGES,
                           posts=POSTS.values(),
                           categories=CATEGORIES)