Django staticfiles finds and serves CSS, JavaScript, and images
Answer: Django calls extra site files such as images, JavaScript, and CSS "static files." The django.contrib.staticfiles app helps you manage them.
Project setup
Include django.contrib.staticfiles in INSTALLED_APPS and set STATIC_URL (for example "static/"). Store files in a static folder inside each app, for example my_app/static/my_app/example.jpg. In templates, the static tag builds the URL for a relative path.
During development, runserver will serve these files automatically when DEBUG is True. That method is unsuitable for production.
Finders
A finder maps a relative path to an absolute file path. FileSystemFinder uses the STATICFILES_DIRS setting. AppDirectoriesFinder looks in each installed app's static directory.
See also
Claims
- id: C1 claim: django.contrib.staticfiles is the helper for managing static files. source: S1 evidence: "Django provides django.contrib.staticfiles to help you manage them."
- id: C2 claim: App static files live in a folder named static inside the app. source: S1 evidence: "Store your static files in a folder called static in your app."
- id: C3 claim: FileSystemFinder locates files using STATICFILES_DIRS. source: S2 evidence: "A static files finder that uses the `
STATICFILES_DIRS` setting to locate files."
- id: C4 claim: AppDirectoriesFinder looks in each app's static directory. source: S2 evidence: "A static files finder that looks in the directory of each app"
Sources
- [S1] Managing static files. Django docs. https://docs.djangoproject.com/en/6.1/howto/static-files/ . License: BSD-3-Clause. Accessed 2026-11-10.
- [S2] django.contrib.staticfiles.finders. Django source. https://github.com/django/django/blob/stable/6.1.x/django/contrib/staticfiles/finders.py . License: BSD-3-Clause. Accessed 2026-11-10.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Django documentation and source (django/django): Copyright (c) Django Software Foundation and individual contributors; BSD-3-Clause (https://raw.githubusercontent.com/django/django/stable/6.1.x/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Django docs, Managing static files, BSD-3-Clause (django/django); Django source, django.contrib.staticfiles.finders, BSD-3-Clause (django/django). Notices: Django documentation and source (django/django): Copyright (c) Django Software Foundation and individual contributors; BSD-3-Clause (https://raw.githubusercontent.com/django/django/stable/6.1.x/LICENSE).
Cite this
iinventedlight. 2026. "Django staticfiles finds and serves CSS, JavaScript, and images." iinventedlight Library, iil:note:rcd4jjhq, version of 2026-11-10. https://iinventedlight.com/library/notes/django-static-files/. License: CC-BY-4.0.
@misc{iil_note_rcd4jjhq,
author = {{iinventedlight}},
title = {{Django staticfiles finds and serves CSS, JavaScript, and images}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-10},
url = {https://iinventedlight.com/library/notes/django-static-files/},
note = {Permanent ID iil:note:rcd4jjhq. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/django-static-files.md.