Closed serkandaglioglu closed 9 years ago
I did this change
from
test = Blueprint('test', "test", template_folder='templates' )
to
test = Blueprint('test', "test", template_folder='app/modules/module_test/templates' )
it worked.
admin = Blueprint('admin', __name__, template_folder='templates')
As for static files, the path can be absolute or relative to the blueprint resource folder. The template folder is added to the searchpath of templates but with a lower priority than the actual application’s template folder. That way you can easily override templates that a blueprint provides in the actual application.
So if you have a blueprint in the folder yourapplication/admin and you want to render the template 'admin/index.html' and you have provided templates as a template_folder you will have to create a file like this: yourapplication/admin/templates/admin/index.html.
You should pass __name__
as second argument to Blueprint.
@untitaker thanks it worked
Glad to hear that.
I am trying to do that example http://flask.pocoo.org/docs/0.10/blueprints/#templates .
My application structure
/app/modules/module_test/controllers.py
the error is "jinja2.exceptions.TemplateNotFound TemplateNotFound: test/index.html". i put index.html in /app/templates/test/index.html and i tried with flask classy it worked.
i want to put template files in blueprint that "/app/modules/module_test/templates". How can i solve this problem?