Skip to content

Template pack tailwind not recognized using {% crispy %} tag #174

@NandaAnzana

Description

@NandaAnzana

I already install crispy-tailwind like the documentation told me to do. But I cannot use {% crispy form %} tag, the error said that crispy tag's template_pack argument should be in ('uni_form', 'bootstrap3', 'bootstrap4'). Did I miss something?

I use:

django-crispy-forms==2.4
crispy-tailwind==1.0.3

In additional, I also have:

django-tailwind==4.2.0

I already registered crispy form and crispy tailwind in my installed apps, this is my settings.py:

INSTALLED_APPS=[
    "crispy_forms",
    "crispy_tailwind",
    ...
]

CRISPY_ALLOWED_TEMPLATE_PACK = "tailwind"
CRISPY_TEMPLATE_PACK = "tailwind"

I also load my article.html like this:

{% extends 'base.html' %}
{% load static i18n %}
{% load crispy_forms_tags %}

{% block head %}
{% endblock head %}

{% block content %}
  <form action="{% url 'articles:write_new' %}" id="article-form" method="post" role="form" enctype="multipart/form-data" class="text-black mt-10 gap-5 flex flex-col">
    {% csrf_token %}
    {% crispy form %}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions