(context: _Context, static_file_path: str)
return "{}/{}".format(static_url.rstrip("/"), static_file_path.lstrip("/"))
Filter for generating urls for static files.

    NOTE: you'll need
    to set app['static_root_url'] to be used as the root for the urls returned.

    Usage: {{ static('styles.css') }} might become
    "/static/styles.css" or "http://mycdn.example.com/styles.css"
Filter for generating urls for static files.
Filter for generating urls for static files .
def static_url(context: _Context, static_file_path: str) -> str:
    """Filter for generating urls for static files.

    NOTE: you'll need
    to set app['static_root_url'] to be used as the root for the urls returned.

    Usage: {{ static('styles.css') }} might become
    "/static/styles.css" or "http://mycdn.example.com/styles.css"
    """
    app = context["app"]
    try:
        static_url = app["static_root_url"]
    except KeyError:
        raise RuntimeError(
            "app does not define a static root url "
            "'static_root_url', you need to set the url root "
            "with app['static_root_url'] = '<static root>'."
        ) from None
    return "{}/{}".format(static_url.rstrip("/"), static_file_path.lstrip("/"))
def static_url ( context : _Context , static_file_path : str ) -> str : app = context [ "app" ] try : static_url = app [ "static_root_url" ] except KeyError : raise RuntimeError ( "app does not define a static root url " "'static_root_url', you need to set the url root " "with app['static_root_url'] = '<static root>'." ) from None return "{}/{}" . format ( static_url . rstrip ( "/" ) , static_file_path . lstrip ( "/" ) )