def METHOD_NAME(config):
    config.scan("h.subscribers")
    config.add_tween("h.tweens.conditional_http_tween_factory", under=EXCVIEW)
    config.add_tween("h.tweens.rollback_db_session_on_exception_factory", under=EXCVIEW)
    config.add_tween("h.tweens.redirect_tween_factory")
    config.add_tween("h.tweens.invalid_path_tween_factory")
    config.add_tween("h.tweens.security_header_tween_factory")
    config.add_tween("h.tweens.cache_header_tween_factory")
    # While exclog is working it can access the database to add extra details
    # like the user id. If we happen after pyramid_tm the connection will have
    # already closed, we'll open another, and then get an unclosed handle.
    config.add_tween(
        "pyramid_exclog.exclog_tween_factory", under="pyramid_tm.tm_tween_factory"
    )
    config.add_request_method(in_debug_mode, "debug", reify=True)
    config.include("pyramid_jinja2")
    config.include("h.jinja_extensions")
    # Register a deferred action to setup the assets environment
    # when the configuration is committed.
    config.action(None, _configure_jinja2_assets, args=(config,))
    _configure_mailer(config)
    # Pyramid service layer: provides infrastructure for registering and
    # retrieving services bound to the request.
    config.include("pyramid_services")
    config.add_settings(
        {
            "tm.manager_hook": lambda request: transaction.TransactionManager(),
            "tm.annotate_user": False,
        }
    )
    config.include("pyramid_retry")
    config.include("pyramid_tm")
    # Add support for logging exceptions whenever they arise
    config.include("pyramid_exclog")
    config.add_settings({"exclog.extra_info": True})
    _configure_csp(config)
    # Core site modules
    config.include("h.assets")
    config.include("h.db")
    config.include("h.eventqueue")
    config.include("h.form")
    config.include("h.realtime")
    config.include("h.renderers")
    config.include("h.routes")
    config.include("h.search")
    config.include("h.security")
    config.include("h.services")
    config.include("h.session")
    config.include("h.viewderivers")
    config.include("h.viewpredicates")
    config.include("h.views")
    # Site modules
    config.include("h.accounts")
    config.include("h.links")
    config.include("h.notification")
    _configure_sentry(config)
    # pyramid-sanity should be activated as late as possible
    config.include("pyramid_sanity")