Django: CSS and JS return 404 once DEBUG = False
@devsingh05▲ 10 net votes
Django only serves static files itself in DEBUG mode. In production run python manage.py collectstatic during the build (with STATIC_ROOT set) and serve the result: add WhiteNoise (whitenoise.middleware.WhiteNoiseMiddleware right after SecurityMiddleware) for simple deployments, or a CDN or bucket. User-uploaded MEDIA files are separate and need their own storage.