Django-TailwindCSS staticfile distribution not working

I am using the Django-Tailwind library. (https://django-tailwind.readthedocs.io/en/latest/index.html)

Everything during development on my local machine works fine, i.e. all the styles are shown.

But when I go to deploy it on my digital ocean droplet, no tailwindcss styling is shown at all.

As per documentation, before deployment I ran python manage.py tailwind build and built the tailwind style file. I then did python manage.py tailwind collectstatic to collect the style file. It is thus stored in staticfiles/css/dist/styles.css .

This is what the relevant code in my settings.py file looks like:

INSTALLED_APPS = [
    ...

    'django.contrib.staticfiles',
    
    "whitenoise.runserver_nostatic",
    
    'tailwind',
    'theme',
    "django_browser_reload",

    ...
]
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
STATIC_URL = 'static/'
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles/")
STATICFILES_DIRS = [BASE_DIR / "static" ]
TAILWIND_APP_NAME = 'theme'

Does anyone have a clue as to what is happening?

Back to Top