So,
can I somehow stop django rendering specific template variables?
Background is, that I wanted to try vuejs in a django app, which kind of worked.
Problem is, both share the same syntax for variables.
So in vuejs you declare them like
{{ message }}
And djangos template engine interprete it as a django template variable and try to render it. Because it doenst exist, it disappear and vuejs isnt working anymore.
According to Vue's docs, its template tag delimiters can be changed to something else, like {!! !!}
, if you want.
If that is not an option, Django has a {% verbatim %}
tag that can escape parts of your template containing Vuejs tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With