About Lesson
Django doesn’t serve static files in production. Use the collectstatic
command to gather static files into a single directory (STATIC_ROOT
), which can be served by a web server.
Configuration
- Set
STATIC_ROOT
insettings.py
: - Run the
collectstatic
command: - Configure your web server (e.g., Nginx) to serve files from the
STATIC_ROOT
directory.
Join the conversation