Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The Blueprint(url_prefix) parameter is not working when using nesting blueprint #4037

Closed
Milestone
@greyli

Description

@greyli

Minimal example:

fromflaskimportFlask,Blueprintapp=Flask(__name__)parent=Blueprint('parent',__name__,url_prefix='/child')child=Blueprint('child',__name__,url_prefix='/parent')@child.get('/')defindex():return'hello'parent.register_blueprint(child)app.register_blueprint(parent)

The output offlask routes:

$ flask routesEndpoint            Methods  Rule------------------  -------  -----------------------parent.child.index  GET      /static              GET      /static/<path:filename>

The URL rule should be/parent/child/ instead of/.

P.S. The URL prefix works fine if set the prefix by usingregister_blueprint(url_prefix).

Environment:

  • Flask version: 2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp