Using Static Files in Django
Let's learn how to serve a static image.
So far, we have used templates to insert simple text. But we don’t always just want text. Sometimes, we want to send other types of media, too. For example, say we wanted to return a user’s photo. For this kind of purpose, we use static files.
What are static files?
Static files are files that clients download as they are from the server or files that get served statically, i.e. with no modification. These static files could include stylesheets, JavaScript files, and images. Now, let’s see how to serve static files.
For this example, we will be using the code we got from the Code Templates in Django lesson. ...