5. Serving Static Files
Overview
In this chapter, you will start by learning the difference between static and dynamic responses. You will then see how the Django staticfiles
app helps manage static files. Continuing work on the Bookr app, you will enhance it with images and CSS. You'll learn the different ways you can lay out your static files for your project and examine how Django consolidates them for production deployment. Django includes tools to reference static files in templates and you'll see how these tools help reduce the amount of work needed when deploying an application to production. After this, you'll explore the findstatic
command, which can be used to debug issues with your static files. Later, you'll get an overview of how to write code for storing static files on a remote service. Finally, you'll look at caching web assets and how Django can help with cache invalidation.