-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support for Jinja2 HTML templates (for a Flask template) #9
Comments
I had a similar problem with creating a Django cookiecutter template (https://github.com/pydanny/cookiecutter-dj-package) that I need to go fix. 😉 I think escaping (http://jinja.pocoo.org/docs/templates/#escaping) is the answer. Try: {{ {{ url_for('home') }} }} If that doesn't work, try: {% raw %}
<p>Go <a href="{{ url_for('home') }}">Home</a></p>
{% endraw %} |
You can also escape just the
Same for escaping I do something similar to escape The downside is that Jinja-templated templates are not the prettiest to read. (Any ideas how to improve this, anyone?) I will add this to the documentation when I get a chance, since it's a common scenario. |
OK, using the |
@audreyr - I think this is resolved. Can you close please? |
ci: update tagged repos
I am in the process of making a Flask cookiecutter template, but I'm running into problems when the Flask Jinja templates are added.
As an example, say I have this template:
Then when I run
cookiecutter cookiecutter-flask
, I get ajinja2.exceptions.UndefinedError
:The text was updated successfully, but these errors were encountered: