<s> from flask import Flask <EOL> from webassets . loaders import PythonLoader as PythonAssetsLoader <EOL> from appname import assets <EOL> from appname . models import db <EOL> from appname . controllers . main import main <EOL> from appname . extensions import ( <EOL> cache , <EOL> assets_env , <EOL> debug_toolbar , <EOL> login_manager <EOL> ) <EOL> def create_app ( object_name ) : <EOL> """<STR_LIT>""" <EOL> app = Flask ( __name__ ) <EOL> app . config . from_object ( object_name ) <EOL> cache . init_app ( app ) <EOL> debug_toolbar . init_app ( app ) <EOL> db . init_app ( app ) <EOL> login_manager . init_app ( app ) <EOL> assets_env . init_app ( app ) <EOL> assets_loader = PythonAssetsLoader ( assets ) <EOL> for name , bundle in assets_loader . load_bundles ( ) . items ( ) : <EOL> assets_env . register ( name , bundle ) <EOL> app . register_blueprint ( main ) <EOL> return app </s>
