FileSystemFinder
So far, we’ve learned about AppDirectoriesFinder
, which loads static files inside Django app directories. However, we expect well-designed apps to be self-contained, and therefore they should only contain static files that they rely on. If we have other static files that are used throughout the website or across different apps, we should store them outside the app directory.
Note
As a general rule, your CSS is probably consistent throughout your site and could be kept in a global directory. Some images and JavaScript code could be specific to apps, so these would be stored in the static
directory for that application. This is just general advice, though: you can store static files anywhere that makes the most sense for your project.
In our business site application, we will be storing a CSS file in a site static
directory as it will be used not only in the landing
app but also throughout the site as we add more apps.
Django provides support for serving...