Skip to main content

with_appcontext

Wraps a callback so that it's guaranteed to be executed with the script's application context.

def with_appcontext(
f: F
) - > F

Wraps a callback so that it's guaranteed to be executed with the script's application context.

Parameters

NameTypeDescription
fFThe callback function or command to be executed within the application context.

Returns

TypeDescription
FThe decorated function wrapped with logic to ensure an active application context during execution.