5

Serving Static Files

A web application with just plain HyperText Markup Language (HTML) is quite limiting. We can enhance the look of web pages with Cascading Style Sheets (CSS) and images, and add interaction with JavaScript. We call all these kinds of files “static files.” They are developed and then deployed as part of the application. We can compare this to dynamic responses, which are generated in real time when a request is made. All the views you have written generate a dynamic response by rendering a template. Note that we will not consider templates to be static files as they are not sent verbatim to a client; instead, they are rendered first and sent as part of a dynamic response.

During development, the static files are created ...

Get Web Development with Django - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.