<p dir="auto"><a href="https://archive.today/VkEJb" rel="nofollow">404</a> on the PDF documentation.</p>
<p dir="auto">When I create a new blueprint, the template_folder is added to a Flask defined path, and the precedence to locate a template is</p>
<ol dir="auto">
<li><code class="notranslate">app/templates/</code> first</li>
<li><code class="notranslate">app/my-blueprint/templates/</code> second</li>
</ol>
<p dir="auto">I understand this makes sense from the point of view of a developer who's trying to reuse the same blueprints on many different projects. He can plug in an existing blueprint and replace the templates from the main app if needed.<br>
There is a different  use case however, where this behavior is unwanted and problematic. That is, when I'm structuring my applications into independent "modules" such that different teams can work independently on their own model/blueprint. The biggest problems is, that blueprints hits templates outside their domain, that is templates defied somewhere else in another blueprint folder. With large projects, this becomes a pretty difficult model to reason on and debug, and the blueprints are too much coupled to one another. Secondly, in this development context I would prefer a blueprint to have precedence over the base templates.<br>
Ideally, I think Flask should have an option to change the precedence of templates. For example use the current behavior by default, but introduce a new config option "blueprints_templates_first=True/False" to be defined somewhere (either at the app level, or for every single blueprint). The expected behavior would be the opposite of the default behavior:</p>
<ol dir="auto">
<li>look in <code class="notranslate">app/my-blueprint/templates/</code> first</li>
<li>look in <code class="notranslate">app/templates/</code> second</li>
<li><strong>do  not</strong> look into other blueprints folders</li>
</ol>
<p dir="auto">I've seen other people come up with the same issue over the years, and I don't understand why there is so much resistance against supporting this feature. There is a real use case for this. I've always appreciated Flask because it's minimalist, concise, powerful, and doesn't get in the way I choose to structure my project. Opposing this option just seems to me as going against the nature of Flask itself, because the framework is dictating to me how I have to structure my files on disk, something that only bigger frameworks do and that Flask has proudly never done. Every workaround to this, such as adding a new inner folder <code class="notranslate">my-blueprint/templates/my-blueprint/</code>, just feels like a hack that goes against the ideas of simplicity and clarity.</p>
<p dir="auto">I, and I believe a lot of other Flask users as well, would really appreciate if you guys could add this configuration option to Flask. Thanks.</p>