How do I extend tailwindcss? #19047
Unanswered
yangmo0113-alt
asked this question in
Help
Replies: 1 comment 2 replies
-
Hi! The issue is that Tailwind with Vite is designed for JavaScript/TypeScript frontends, but you're using Django (Python backend). For Django + Tailwind, you need a different setup:Option 1: Use Tailwind CLI (Recommended for Django)
npm install -D tailwindcss
npx tailwindcss init
module.exports = {
content: [
'./templates/**/*.html',
'./your_app/**/*.html',
],
theme: {
extend: {},
},
}
npx tailwindcss -i ./static/css/input.css -o ./static/css/output.css --watch Option 2: Use django-tailwind packagepip install django-tailwind Then follow: https://django-tailwind.readthedocs.io/ The Vite guide won't work with Django because Django serves templates differently than Vite's dev server. Hope this helps! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i have few questions want to know
1.first , I have followed all the steps on the official website.
[https://tailwindcss.com/docs/installation/using-vite]
But I use Django in vs code to write,However, when executing runserver, the tailwindcss template is still not applied.

But so the enhancements I made in tailwind.config.js are applied. I think my output.css does not have these kits?
Finally, I'd like to try installing https://github.com/tailwindlabs/tailwindcss, but I don't know how to proceed.


I hope to get the answer. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions