def quote_page(quote_id=None): if quote_id is None: return redirect(str(db.get_quote()['id'])) else: quote = db.get_quote(quote_id) return render_template('quote_page.html', quote_text=quote['text'], quote_author=quote['author'])
def ajax_quote(): json_data = json.dumps(db.get_quote()) return Response(json_data, mimetype='application/json')