Skip to main content

get_script_prefix

Return the script prefix to use from either the scope or a setting.

def get_script_prefix(
scope: dict
) - > string

Return the script prefix to use from either the scope or a setting.

Parameters

NameTypeDescription
scopedictThe ASGI connection scope dictionary containing request metadata like root_path.

Returns

TypeDescription
stringThe script prefix string, prioritizing the FORCE_SCRIPT_NAME setting over the scope's root path.