Guided Notes

Static Files & Styling

Serving CSS, JavaScript, and images, the static template tag, collectstatic, WhiteNoise, and adding Bootstrap.

What are static files?

Slide 1 / 5

Static files are files served as-is: CSS stylesheets, JavaScript, images, and fonts. Unlike templates, Django doesn't process them.

Put app-specific files in the app's static/ folder, namespaced by app:

library/static/library/styles.css

Project-wide files go in a folder listed in STATICFILES_DIRS (e.g. static/ at the project root).

← Forms