def init_app(application):
    """
    Initialise an application

    Set up whitenoise to handle static files.
    """
    config = {k: v for k, v in application.config.items() if k in SCHEMA}

    kwargs = {'autorefresh': application.debug}

    kwargs.update((k[11:].lower(), v) for k, v in config.items())

    instance = whitenoise.WhiteNoise(application.wsgi_app, **kwargs)

    instance.add_files(application.static_folder, application.static_url_path)

    if not hasattr(application, 'extensions'):
        application.extensions = {}

    application.extensions['whitenoise'] = instance

    application.wsgi_app = instance
def init_app ( application ) : config = { k : v for k , v in application . config . items ( ) if k in SCHEMA } kwargs = { 'autorefresh' : application . debug } kwargs . update ( ( k [ 11 : ] . lower ( ) , v ) for k , v in config . items ( ) ) instance = whitenoise . WhiteNoise ( application . wsgi_app , ** kwargs ) instance . add_files ( application . static_folder , application . static_url_path ) if not hasattr ( application , 'extensions' ) : application . extensions = { } application . extensions [ 'whitenoise' ] = instance application . wsgi_app = instance
Initialise an application

    Set up whitenoise to handle static files.