<h3 dir="auto">Expected Behavior</h3>

<p dir="auto">i created 2 blueprint <strong>main</strong> and <strong>mobile</strong>. i expect mobile blueprint to render its own template.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="blueprint = Blueprint(
        name='mobile',
        import_name=__name__,
        static_folder='assets',
        static_url_path='/mobile_assets',
        # app_cfg.APPPATH is a constant of absolute path to app root directory
        template_folder=path.join(app_cfg.APPPATH,'blueprint/mobile/template'),
    )

@blueprint.route('/', methods=['GET'])
def index_mobile():
    data = {
        'title': 'wow mobile',
        'message': 'message from mobile blueprint'
    }
    # to test if i set the corrent absolute path to the blueprint template
    print(path.join(app_cfg.APPPATH,'blueprint/mobile/template'))
    return render_template('index.html',**data)"><pre class="notranslate"><span class="pl-s1">blueprint</span> <span class="pl-c1">=</span> <span class="pl-v">Blueprint</span>(
        <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'mobile'</span>,
        <span class="pl-s1">import_name</span><span class="pl-c1">=</span><span class="pl-s1">__name__</span>,
        <span class="pl-s1">static_folder</span><span class="pl-c1">=</span><span class="pl-s">'assets'</span>,
        <span class="pl-s1">static_url_path</span><span class="pl-c1">=</span><span class="pl-s">'/mobile_assets'</span>,
        <span class="pl-c"># app_cfg.APPPATH is a constant of absolute path to app root directory</span>
        <span class="pl-s1">template_folder</span><span class="pl-c1">=</span><span class="pl-s1">path</span>.<span class="pl-en">join</span>(<span class="pl-s1">app_cfg</span>.<span class="pl-v">APPPATH</span>,<span class="pl-s">'blueprint/mobile/template'</span>),
    )

<span class="pl-en">@<span class="pl-s1">blueprint</span>.<span class="pl-en">route</span>(<span class="pl-s">'/'</span>, <span class="pl-s1">methods</span><span class="pl-c1">=</span>[<span class="pl-s">'GET'</span>])</span>
<span class="pl-k">def</span> <span class="pl-en">index_mobile</span>():
    <span class="pl-s1">data</span> <span class="pl-c1">=</span> {
        <span class="pl-s">'title'</span>: <span class="pl-s">'wow mobile'</span>,
        <span class="pl-s">'message'</span>: <span class="pl-s">'message from mobile blueprint'</span>
    }
    <span class="pl-c"># to test if i set the corrent absolute path to the blueprint template</span>
    <span class="pl-en">print</span>(<span class="pl-s1">path</span>.<span class="pl-en">join</span>(<span class="pl-s1">app_cfg</span>.<span class="pl-v">APPPATH</span>,<span class="pl-s">'blueprint/mobile/template'</span>))
    <span class="pl-k">return</span> <span class="pl-en">render_template</span>(<span class="pl-s">'index.html'</span>,<span class="pl-c1">**</span><span class="pl-s1">data</span>)</pre></div>
<h3 dir="auto">Actual Behavior</h3>

<p dir="auto">mobile blueprint render the template from <strong>main</strong></p>

<p dir="auto">there is already an issue about this since 2015. but for some unknown reason its closed without mentioning any solution for this problem.</p>
<p dir="auto">flask documention :<br>
<code class="notranslate">template_folder – A folder with templates that should be added to the app’s template search path. The path is relative to the blueprint’s root path. Blueprint templates are disabled by default. Blueprint templates have a lower precedence than those in the app’s templates folder.</code></p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Python version: Python 3.8.5</li>
<li>Flask version: Flask 1.1.2</li>
<li>Werkzeug version: Werkzeug 1.0.1</li>
</ul>
<ol dir="auto">
<li>File structure:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="project -
      - templates \
                - a \
                      search.html
                - b \
                      search.html
      - start.py
      - myapplication \
                - test.py "><pre class="notranslate"><code class="notranslate">project -
      - templates \
                - a \
                      search.html
                - b \
                      search.html
      - start.py
      - myapplication \
                - test.py 
</code></pre></div>
<ol dir="auto">
<li>Start file:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# start.py
from flask import Flask
from myapplication.test import test_blueprint

app = Flask(__name__)
app.register_blueprint(test_blueprint)"><pre class="notranslate"><code class="notranslate"># start.py
from flask import Flask
from myapplication.test import test_blueprint

app = Flask(__name__)
app.register_blueprint(test_blueprint)
</code></pre></div>
<ol dir="auto">
<li>my application</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# test.py
from flask import Blueprint, render_template, abort
from jinja2 import TemplateNotFound

test_blueprint = Blueprint('test_blueprint', __name__,
                        template_folder='absolute_path_to_project/templates/a')  
                        # YES, I specified the absolute path to the template a

@test_blueprint.route('/test')
def show():
    try:
        return render_template(''search.html&quot;) # HERE is the problem
    except TemplateNotFound:
        abort(404)"><pre class="notranslate"><code class="notranslate"># test.py
from flask import Blueprint, render_template, abort
from jinja2 import TemplateNotFound

test_blueprint = Blueprint('test_blueprint', __name__,
                        template_folder='absolute_path_to_project/templates/a')  
                        # YES, I specified the absolute path to the template a

@test_blueprint.route('/test')
def show():
    try:
        return render_template(''search.html") # HERE is the problem
    except TemplateNotFound:
        abort(404)
</code></pre></div>
<p dir="auto">Is this a problem?<br>
# Actually, I want to render <strong>a/search.html</strong><br>
# But, <code class="notranslate">render_template()</code> does not use <strong>test_blueprint's template_folder</strong><br>
# <code class="notranslate">render_template()</code> search the <strong>template list</strong>, find the first <strong>search.html</strong>, then render<br>
# So, maybe render <strong>a/search.html</strong> or <strong>b/search.html</strong><br>
# This depend on the sequence of the <strong>template list</strong></p>