2022-06-17 14:48:23 +00:00
|
|
|
from .base import (
|
2023-02-18 16:04:14 +00:00
|
|
|
captcha, csrf, login_manager, handle_bad_request, handle_unauthorized_access,
|
2022-06-17 14:48:23 +00:00
|
|
|
handle_access_forbidden, handle_page_not_found, handle_internal_server_error
|
|
|
|
)
|
2019-12-02 03:32:03 +00:00
|
|
|
|
|
|
|
from .index import index_bp
|
|
|
|
from .user import user_bp
|
|
|
|
from .dashboard import dashboard_bp
|
|
|
|
from .domain import domain_bp
|
|
|
|
from .admin import admin_bp
|
2022-06-17 14:48:23 +00:00
|
|
|
from .api import api_bp, apilist_bp
|
2019-12-02 03:32:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
def init_app(app):
|
|
|
|
login_manager.init_app(app)
|
2022-05-27 10:53:19 +00:00
|
|
|
csrf.init_app(app)
|
2023-02-18 16:04:14 +00:00
|
|
|
captcha.init_app(app)
|
2019-12-02 03:32:03 +00:00
|
|
|
|
|
|
|
app.register_blueprint(index_bp)
|
|
|
|
app.register_blueprint(user_bp)
|
|
|
|
app.register_blueprint(dashboard_bp)
|
|
|
|
app.register_blueprint(domain_bp)
|
|
|
|
app.register_blueprint(admin_bp)
|
|
|
|
app.register_blueprint(api_bp)
|
2022-06-17 14:48:23 +00:00
|
|
|
app.register_blueprint(apilist_bp)
|
2019-12-02 03:32:03 +00:00
|
|
|
|
|
|
|
app.register_error_handler(400, handle_bad_request)
|
|
|
|
app.register_error_handler(401, handle_unauthorized_access)
|
|
|
|
app.register_error_handler(403, handle_access_forbidden)
|
|
|
|
app.register_error_handler(404, handle_page_not_found)
|
|
|
|
app.register_error_handler(500, handle_internal_server_error)
|