timonweb/django-tailwind

Including `tailwind start` in `runserver` command?

Spaxterr opened this issue · 2 comments

Hello, we are currently looking into implementing tailwind to our Django project. Initially, django-tailwind seems like a good option. However, I noticed that it requires you to run the watcher alongside the Django server. It would be highly beneficial for us if the python3 manage.py tailwind start command could be baked into the python3 manage.py runserver command.

This is because we want to introduce tailwind as seamlessly as possible. The current approach would require us to teach every developer on our team to always start the tailwind watcher as well.

What's wrong with writing your own runserver command? If you want to make it super convenient, you should even be able to override the original one.

I tried creating a dev.sh script to run both, but the first command auto-exits soon after the script file is run. Is there a way to get both commands to start in a bash script?

dev.sh (NB: this doesn't work, only runserver stays running):

#!/usr/bin/env bash
# Exit on error
set -o errexit

python3 manage.py tailwind start &
python3 manage.py runserver