{"action":"created","issue":{"url":"https://api.github.com/repos/pallets/flask/issues/1361","repository_url":"https://api.github.com/repos/pallets/flask","labels_url":"https://api.github.com/repos/pallets/flask/issues/1361/labels{/name}","comments_url":"https://api.github.com/repos/pallets/flask/issues/1361/comments","events_url":"https://api.github.com/repos/pallets/flask/issues/1361/events","html_url":"https://github.com/pallets/flask/issues/1361","id":59588480,"number":1361,"title":"Method `render_template` does not use blueprint specified `template_folder`","user":{"login":"Kevin922","id":3774756,"avatar_url":"https://avatars.githubusercontent.com/u/3774756?v=3","gravatar_id":"","url":"https://api.github.com/users/Kevin922","html_url":"https://github.com/Kevin922","followers_url":"https://api.github.com/users/Kevin922/followers","following_url":"https://api.github.com/users/Kevin922/following{/other_user}","gists_url":"https://api.github.com/users/Kevin922/gists{/gist_id}","starred_url":"https://api.github.com/users/Kevin922/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kevin922/subscriptions","organizations_url":"https://api.github.com/users/Kevin922/orgs","repos_url":"https://api.github.com/users/Kevin922/repos","events_url":"https://api.github.com/users/Kevin922/events{/privacy}","received_events_url":"https://api.github.com/users/Kevin922/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pallets/flask/labels/blueprints","name":"blueprints","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-03-03T03:06:26Z","updated_at":"2016-05-22T09:40:56Z","closed_at":null,"body":"1. File structure:\r\n```\r\nproject -\r\n      - templates \\\r\n                - a \\\r\n                      search.html\r\n                - b \\\r\n                      search.html\r\n      - start.py\r\n      - myapplication \\\r\n                - test.py \r\n```\r\n\r\n2. Start file:\r\n```\r\n# start.py\r\nfrom flask import Flask\r\nfrom myapplication.test import test_blueprint\r\n\r\napp = Flask(__name__)\r\napp.register_blueprint(test_blueprint)\r\n```\r\n\r\n3. my application\r\n```\r\n# test.py\r\nfrom flask import Blueprint, render_template, abort\r\nfrom jinja2 import TemplateNotFound\r\n\r\ntest_blueprint = Blueprint('test_blueprint', __name__,\r\n                        template_folder='absolute_path_to_project/templates/a')  \r\n                        # YES, I specified the absolute path to the template a\r\n\r\n@test_blueprint.route('/test')\r\ndef show():\r\n    try:\r\n        return render_template(''search.html\") # HERE is the problem\r\n    except TemplateNotFound:\r\n        abort(404)\r\n```\r\n\r\nIs this a problem? \r\n        # Actually, I want to render **a/search.html**\r\n        # But, `render_template()` does not use **test_blueprint's template_folder**\r\n        # `render_template()` search the **template list**, find the first **search.html**, then render\r\n        # So, maybe render **a/search.html** or **b/search.html**\r\n        # This depend on the sequence of the **template list**\r\n"},"comment":{"url":"https://api.github.com/repos/pallets/flask/issues/comments/220823213","html_url":"https://github.com/pallets/flask/issues/1361#issuecomment-220823213","issue_url":"https://api.github.com/repos/pallets/flask/issues/1361","id":220823213,"user":{"login":"ThiefMaster","id":179599,"avatar_url":"https://avatars.githubusercontent.com/u/179599?v=3","gravatar_id":"","url":"https://api.github.com/users/ThiefMaster","html_url":"https://github.com/ThiefMaster","followers_url":"https://api.github.com/users/ThiefMaster/followers","following_url":"https://api.github.com/users/ThiefMaster/following{/other_user}","gists_url":"https://api.github.com/users/ThiefMaster/gists{/gist_id}","starred_url":"https://api.github.com/users/ThiefMaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThiefMaster/subscriptions","organizations_url":"https://api.github.com/users/ThiefMaster/orgs","repos_url":"https://api.github.com/users/ThiefMaster/repos","events_url":"https://api.github.com/users/ThiefMaster/events{/privacy}","received_events_url":"https://api.github.com/users/ThiefMaster/received_events","type":"User","site_admin":false},"created_at":"2016-05-22T09:40:56Z","updated_at":"2016-05-22T09:40:56Z","body":"How would you avoid the warning if you don't want any url rules in your main app (e.g. because you have an `api` and `frontend` blueprint)? Having `templates/frontend/index.html` and using `render_template('frontend/index.html')`? Feels like something where at config option would be appropriate to disable the warning for applications where there's only one blueprint that contains templates and adding a subdirectory would just add extra noise."}}
{"actor":{"display_login":"ThiefMaster"}}