Commit ffc8e2e0 authored by Julien Phalip's avatar Julien Phalip
Browse files

Fixes #20162 -- Added a note in the documentation for `static.serve()` about...

Fixes #20162 -- Added a note in the documentation for `static.serve()` about the need for updating the system's map files when incorrect content types are returned. Many thanks to Simon Charette and Claude Paroz for their feedback.
parent 91d06ea7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -350,6 +350,16 @@ This view function serves static files in development.
    **insecure**. This is only intended for local development, and should
    **never be used in production**.

.. note::

    To guess the served files' content types, this view relies on the
    :py:mod:`mimetypes` module from the Python standard library, which itself
    relies on the underlying platform's map files. If you find that this view
    doesn't return proper content types for certain files, it is most likely
    that the platform's map files need to be updated. This can be achieved, for
    example, by installing or updating the ``mailcap`` package on a Red Hat
    distribution, or ``mime-support`` on a Debian distribution.

This view is automatically enabled by :djadmin:`runserver` (with a
:setting:`DEBUG` setting set to ``True``). To use the view with a different
local development server, add the following snippet to the end of your