pallets / flask

The Python micro framework for building web applications.
https://flask.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
68.02k stars 16.21k forks source link

Blueprint view with same name will be override #1060

Closed steelywing closed 10 years ago

steelywing commented 10 years ago

Reproduce:



Is it the cache issue ? I tried if rename blueprint_0/index.html to blueprint_0/bp_0.html, and blueprint_1/index.html to blueprint_1/bp_1.html, all work. I also add a test of this, please have a see of THIS

mitsuhiko commented 10 years ago

This is documented behavior. Blueprints resolve template names globally. Their template folder should contain another level which for instance could be the name of the blueprint.

This is done so that one blueprint can provide templates for another blueprint.

steelywing commented 10 years ago

@mitsuhiko Thanks for reply, this pull will not break the original behavior (blueprint can provide templates for another blueprint), it only prefer to use their template, would you consider again ? =)

mitsuhiko commented 10 years ago

No. We had something like this originally in Flask 0.7 (before blueprints) or so and it caused problems which is why it was changed.