Closes #1
This commit is contained in:
parent
57df913a2c
commit
00f7c1de33
3 changed files with 34 additions and 4 deletions
|
|
@ -66,6 +66,13 @@ def get_post(id, check_author=True):
|
|||
|
||||
return post
|
||||
|
||||
@bp.route('/<int:id>')
|
||||
def post(id):
|
||||
post = get_post(id, check_author=False)
|
||||
post = dict(post)
|
||||
post['body'] = markdown.markdown(post['body'])
|
||||
return render_template('blog/post.html', post=post)
|
||||
|
||||
@bp.route('/<int:id>/update', methods=('GET', 'POST'))
|
||||
@login_required
|
||||
def update(id):
|
||||
|
|
@ -101,3 +108,7 @@ def delete(id):
|
|||
db.execute('DELETE FROM post WHERE id = ?',(id,))
|
||||
db.commit()
|
||||
return redirect(url_for('blog.index'))
|
||||
|
||||
@bp.route('/temp')
|
||||
def temp():
|
||||
return render_template('temp.html')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue