def build_app(db_driver=None): """Build app and disable debug mode in case of production """ web.config.debug = bool(int(settings.DEVELOPMENT)) app = web.application(urls(), locals()) app.add_processor(db_driver or load_db_driver) app.add_processor(forbid_client_caching) return app