Esempio n. 1
0
def index(request):    
    if isGet(request): 
        indexView = IndexView(request)   
        if indexView.list():
            return indexView.getRender() 
        else:
            return None 
    elif isPost(request):
        pass
Esempio n. 2
0
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'):