Deploying
Install uv
pip install uv
Install dependencies
Install the production dependencies
uv export --frozen > requirements.txt
uv pip install -r requirements.txt
If using Tailwind, TypeScript or Sass etc.
npm ci
Compile project
To compile for production, run
export NODE_PATH=$(pwd)/node_modules
python manage.py build
Collect statics
Collect asset files and static files in the STATIC_ROOT folder
python manage.py collectstatic
Serve statics
Configure the production server to serve the collected static files in the STATIC_ROOT folder under the STATIC_URL.
See How to deploy static files guide to learn more.
Or you can use WhiteNoise to automatically serve static files.
Start server
Now start the production server using wsgi or asgi. Go to django How to deploy Django documentation to learn more.