-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blueprint template not found #66
Comments
I did this change from test = Blueprint('test', "mest", template_folder='templates' ) to test = Blueprint('test', "mest", template_folder='app/modules/module_test/templates' ) it worked. But Flask documentation says that: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 are not following the documentation, you need to actually pass |
@danielchatfield thanks. it worked |
Thank for flask-classy. I am coming from php codeigniter and flask-classy helped me very much.
I have a problem.
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
When i tried blueprint without flask-classy it worked, but when i tried with flask-classy it did not work , 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?
The text was updated successfully, but these errors were encountered: