<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’m not sure if this answers your question:<div class=""><br class=""></div><div class="">The structure you reference is for project and maintenance organization, keeping blueprint assets together.<div class="">Blueprints can also go in the main templates folder at root of project.</div><div class=""><br class=""></div><div class="">Ex:</div><div class="">yourpackage/</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>blueprints/</div><div class=""><span class="Apple-tab-span" style="white-space:pre">               </span>admin/</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                    </span>__init__.py</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">                     </span>models.py</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                 </span>views.py</div><div class=""><span class="Apple-tab-span" style="white-space:pre">          </span></div><div class=""><span class="Apple-tab-span" style="white-space:pre">  </span>templates/  (main templates folder)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">          </span>admin/</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                    </span>index.html</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>blueprint2/</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                       </span>index.html </div><div class=""><span class="Apple-tab-span" style="white-space:pre">          </span>blueprint3/</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                       </span>index.html<br class=""><div apple-content-edited="true" class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0);" class=""><br class=""></div><div style="color: rgb(0, 0, 0);" class="">The subfolders are used because blueprints may have templates named the same.</div><div style="color: rgb(0, 0, 0);" class="">For example, if all the templates were in a single directory, they would need to be name without conflict.</div><div style="color: rgb(0, 0, 0);" class=""><br class=""></div><div style="color: rgb(0, 0, 0);" class="">yourpackage/</div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">  </span>blueprints/</div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>etc.</div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">       </span></div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">   </span>templates/ (main templates folder)</div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">         </span>admin_index.html</div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">           </span>blueprint1_index.html</div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">              </span>blueprint2_index.html</div><div style="color: rgb(0, 0, 0);" class=""><span class="Apple-tab-span" style="white-space:pre">              </span>blueprint3_index.html</div><div style="color: rgb(0, 0, 0);" class=""><br class=""></div><div style="color: rgb(0, 0, 0);" class="">Also, when defining the a blueprint, the corresponding template can be defined when declaring the blueprint using <font face="Courier New" class="">templates_folder</font> attribute.</div><div style="color: rgb(0, 0, 0);" class="">By using this parameter, you point to the blueprint’s template directory once, and the associated views will look in that directory.</div><div style="color: rgb(0, 0, 0);" class=""><br class=""></div><div style="color: rgb(0, 0, 0);" class="">--</div><div style="color: rgb(0, 0, 0);" class=""><br class=""></div></div></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 18, 2018, at 1:33 PM, Laura Morales <<a href="mailto:lauretas@mail.com" class="">lauretas@mail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">The documentation [1] says to use this structure for blueprint templates:<br class=""><br class=""><br class="">yourpackage/<br class="">    blueprints/<br class="">        admin/<br class="">            templates/<br class="">                admin/<br class="">                    index.html<br class="">            __init__.py<br class=""><br class=""><br class="">but it looks like a hack to me. Is there any flag that I can toggle, such that "<blueprint>/index.html" will automatically reference a blueprint without the need to create the additional folder? For example "admin/index.html" will locate the file "yourpackage/blueprints/admin/templates/index.html"<br class=""><br class=""><br class="">[1] <a href="http://flask.pocoo.org/docs/0.12/blueprints/#templates" class="">http://flask.pocoo.org/docs/0.12/blueprints/#templates</a><br class="">_______________________________________________<br class="">Flask mailing list<br class=""><a href="mailto:Flask@python.org" class="">Flask@python.org</a><br class="">https://mail.python.org/mailman/listinfo/flask<br class=""></div></blockquote></div><br class=""></div></div></body></html>