You need to properly configure STATIC_ROOT
and STATIC_URL
for production. Depending on STATICFILES_DIRS
and what STATICFILES_FINDERS
you have configured, your static sources will be located together with your application's sources, while the STATIC_ROOT
must be outside the path of your sources since this data is transient by nature.
This means that you must rely on running $ python manage.py collectstatic
in production. Paths matching STATIC_URL
should be handled by your web server, with the root configured to match STATIC_ROOT
from where the files will be served.
You can review the django.contrib.staticfiles
app guide and the guide on deploying static files in production from the documentation for more nitty-gritty details.