【问题标题】:How can I add tailwind css to an existing django app如何将顺风 css 添加到现有的 django 应用程序
【发布时间】:2021-12-10 20:03:39
【问题描述】:

我已经有一个包含许多应用程序的 Django 项目,其中之一是 demo_app。我在演示应用程序中添加了一些视图和模板,但我想开始在 demo_app 模板中使用 tailwind。我已经看到要添加tailwind,我需要使用tailwind 创建主题应用程序,但我想将它添加到已经存在的demo_app 中。我该怎么做?

【问题讨论】:

    标签: django tailwind-css


    【解决方案1】:

    您可以像文档中所说的那样创建主题应用程序,并将标签添加到您现有的应用程序中。我按照this link 中的流程进行操作。应用程序中的 js 配置已经在其他应用程序中查找 tailwind 标签。我使用的标签是 {% load static tailwind_tags %}{% tailwind_css %}。我将它们添加到现有应用程序的 html 模板中。

    模板顶部的{% load static tailwind_tags %}<head> 中的{% tailwind_css %}

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-29
      • 2015-12-28
      • 1970-01-01
      • 2016-09-25
      • 2013-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多