accountant-ui/frontend/__init__.py
2013-12-03 21:34:40 +01:00

20 lines
554 B
Python

from flask import Blueprint, redirect, render_template, jsonify
frontend = Blueprint('frontend', __name__, template_folder='templates', static_folder='static')
@frontend.route('/')
def root():
return redirect('index.html')
@frontend.route('/index.html')
def index():
return render_template('index.html')
@frontend.route('/scheduler.html')
def scheduler():
return render_template('scheduler.html')
@frontend.errorhandler(BaseException)
def default_errorhandler(error):
return jsonify(title="Error", text="Error %s" % str(error)), 500