Skip to content

Support zero-ceremony sub-app mounting (including Blueprints) #1548

@svieira

Description

@svieira

#1361, #1498, and #1494 seem to indicate that some people don't see Blueprints as templates for application behavior, but want to treat them as little self-contained applications that are composed onto the main application. Effectively, we would be taking the app composition pattern and building it into the API.

What sort of an API would we need to properly support app composition for such purposes, since that would solve all of these use cases (404 / 405 error handlers at the "Blueprint" level, only able to see its own templates, etc.)?

The minimum API is Flask#mount_app(app_or_blueprint) - but that still leaves a few questions:

  1. Does the parent app need to be able to route to sub-app routes via url_for?
  2. Does the child app need to be able to route to parent or sibling-app routes via url_for?
  3. Ditto for static and templates (although Method render_template does not use blueprint specified template_folder #1361 suggests that such uses would want the static and template folders to be distinct).
  4. Other questions which I am certainly missing

What do you need from Blueprints? What else would you expect Flask#mout_app to do?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions