STATICFILES_DIRS prefixed mode
As mentioned earlier, the STATICFILES_DIRS
setting also accepts items as tuples in the form of (prefix, directory)
. These modes of operation are not mutually exclusive; STATICFILES_DIRS
may contain both non-prefixed (string) or prefixed (tuple) items. Essentially, this allows you to map a certain URL prefix to a directory. In Bookr, we do not have enough static assets to warrant setting this up, but it can be useful if you want to organize your static assets differently. For example, you can keep all your images in a certain directory, and all your CSS in another directory. You might need to do this if you use a third-party CSS generation tool such as Node.js with LESS.
Note
LESS is a CSS pre-processor that uses Node.js. It allows you to write CSS using variables and other programming-like concepts that don’t exist natively. Node.js will then compile this to CSS. A more in-depth explanation is outside the scope of this book; suffice it to...