def edit(id): is_login() post = db.view_post(id) if request.method == 'POST': title = request.form['title'] content = request.form['content'] tags = request.form['tags'] db.edit_entry(id, title, content, tags) return redirect(url_for('index')) return render_template('edit.html', post=post)
def viewpost(id): post = db.view_post(id) return render_template('post.html', post=post)