Skip to content
Discussion options

You must be logged in to vote

I found a way doing this using something like this:

def setup():
    """
    This function is called after app is available (via on_startup)
    """
    another.function(app)

app = FastAPI(
    ...
    on_startup=[..., startup],
)

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
Converted from issue

This discussion was converted from issue #1142 on February 28, 2023 10:18.