Starting with version
3.1.0, Django-Tailwind is dropping support for Node.JS-based
browser-sync and switching to Django-based
django-browser-reload as the primary solution for seamless page and asset updates during development.
If you generated Tailwind CSS before
3.1.0, I strongly suggest you to upgrade your project.
If you don’t want to upgrade and are happy with
browser-sync, make sure that you have
TAILWIND_DEV_MODE=DEBUGset in your
Please follow the following migration steps.
Upgrade Django-Tailwind to its latest version:
pip install django-tailwind --upgrade
INSTALLED_APPS = [ # other Django apps 'tailwind', 'theme', 'django_browser_reload' ]
settings.py, add the middleware:
MIDDLEWARE = [ # ... "django_browser_reload.middleware.BrowserReloadMiddleware", # ... ]
The middleware should be listed after any that encode the response, such as Django’s
GZipMiddleware. The middleware automatically inserts the required script tag on HTML responses before
django_browser_reloadURL in your root
from django.urls import include, path urlpatterns = [ ..., path("__reload__/", include("django_browser_reload.urls")), ]
static_srcdirectory. In my case,
theme, thus I
bs.config.jsfile from the
theme/static_srcdirectory, and remove the following commands under
package.json, rename the
dev. That’s the only command we need for development from now on.
Staying in the same directory, uninstall dependencies we don’t need anymore, run the following command:
npm uninstall browser-sync nodemon npm-run-all
python manage.py tailwind startto make sure everything runs properly.