accountant/accountant/frontend/__init__.py
2015-06-05 23:34:04 +02: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