This is example how to setup Django with Tailwind CSS framework.
- Python 3.4 or higher
- Node.js
- npm or yarn - package managers
- pip - tool for installing and managing Python packages
- virtualenv - tool to keep the dependencies required by different projects in separate places
These commands are valid for Mac/Ubuntu OS. If you develop on Windows, you should replace them with proper commands, If you are using the default Windows Command Line.
- Create virtual environment in your project folder
python3 -m venv venv
- Activate the virtual environment
source venv/bin/activate
- Install required libraries and packages
pip3 install -r requirements.txt
- Navigate to the project root
- Install Tailwind
python3 manage.py tailwind install
- Setup path to your npm installation
which npm
(or yarn) - Setup ENV variable in
project/settings.py
NPM_BIN_PATH={your path}
- Install Tailwind dependencies
python3 manage.py tailwind install
- Migrate database
python3 manage.py migrate
- Run server
python3 manage.py runserver
in one terminal - Run Tailwind
python3 manage.py tailwind start
in another terminal