def index(request): if isGet(request): indexView = IndexView(request) if indexView.list(): return indexView.getRender() else: return None elif isPost(request): pass
lm.init_app(app) lm.login_view = "LoginView:index" @lm.user_loader def load_user(userid): from models import User return User.query.get(userid) from IndexView import IndexView from BlogView import BlogView from LoginView import LoginView from RegisterView import RegisterView from ToolsView import ToolsView IndexView.register(app, route_base='/') BlogView.register(app, route_base='/blog') LoginView.register(app, route_base='/login') RegisterView.register(app, route_base='/register') ToolsView.register(app, route_base='/tools') from admin import HexAdmin, HexAdminHome admin = HexAdmin(index_view=HexAdminHome()) admin.start(app) @app.errorhandler(Exception) def generic_error_handler(error): app.logger.exception(error) from datetime import datetime if hasattr(error, 'code'):