I want to use Jinja2 and Django crispy forms together, but when I load crispy_forms_tags in my template and trying to render form with this template tag, I get an error:
Encountered unknown tag 'crispy'. Jinja was looking for the following tags: 'endblock'. The innermost block that needs to be closed is 'block'.
My template code:
{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% block content %}
<div class="panel-heading"><h3>Registration</h3></div>
{% crispy form %}
{% endblock %}
How can I use this apps together?
Better solution:
templatetags.py
In template:
I found an easy, but not completed way to "hack in".
in the filter file, define a crispy filter, which looks like:
In the form Jinja template, I have to write more code than direct crispy tag in django template:
If anyone finds a more effective way to crispy forms, please let me know.