16.1 Introduction
Websites are usually a combination of HTML, CSS, JavaScript, and media. At the moment, our website is HTML only, which means it’s rather uninspiring. The goal of this chapter is to add CSS and an image (a site logo) to our website. Django refers to this content as static content because Django is not generating the content, unlike HTML (or any other markup).
Adding an image or a CSS file is quite simple: we could simply edit any of our templates to add an HTML tag (img, link, etc.) to connect to our files. The trick, once again, is maintaining DRY. Django provides the staticfiles contributed app as a means to organize nongenerated files. Specifically, the app allows us to move these files to different directories: Django will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access