This commit is contained in:
Punnamaraju Vinayaka Tejas 2023-07-28 19:47:32 +05:30
parent 57df913a2c
commit 00f7c1de33
3 changed files with 34 additions and 4 deletions

View file

@ -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')