Configuring the static and dynamic files in Django is essential. How we configure and serve static and media files does impact on the overall performance of the application. Hence, configuring the static and media files should be taken care of in an optimized way. Let's have a detailed discussion about it.
Django has a standard pattern to configure the static and media files. Static and media are two different concerns, where static files refer to fixed content, such as HTML, JS, CSS, and images. Django defines some configuration related to static files in settings.py
and URL configured in urls.py
. Media files refer to any files that are handled dynamically by uploading. Django has a very good mechanism to configure and manage static HTML, JS, CSS, and images files.
Normally, the default Django static file configuration assumes that you will have static files along with your code base under a static directory, but, in our case, we want...