Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanic.get_app with no app name #2048

Closed
ahopkins opened this issue Mar 7, 2021 · 0 comments · Fixed by #2053
Closed

Sanic.get_app with no app name #2048

ahopkins opened this issue Mar 7, 2021 · 0 comments · Fixed by #2053

Comments

@ahopkins
Copy link
Member

ahopkins commented Mar 7, 2021

Is your feature request related to a problem? Please describe.

Sometimes you want to get the app instance, but do not have the name of the app.

app = Sanic.get_app("what was it called again 🤔")

Describe the solution you'd like

    @classmethod
    def get_app(cls, name: Optional[str], *, force_create: bool = False) -> "Sanic":
        # If name is None, then return the first item in the app registry

Additional context

See docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant