Django itself is not used to serve media files; You should leave this job to the Web server you choose. We recommend using a separate Web server (that is, one that does not run Django) to serve media. For more information, see the section below.
However, if you have no other choice, you can only serve media files on the same Django Apache VirtualHost, where you could turn off Mod_python for a specific part of the site:
SetHandler None
Change location to the root directory where your media files are located.
You can also use to match regular expressions. For example, the following syntax defines Django to the root of the Web site, and explicitly masks the media subdirectory and any URLs that end with. jpg,. gif, or. png:
SetHandler python-program pythonhandler django.core.handlers.modpython SetEnv django_settings_ MODULE mysite.settings
SetHandler None
SetHandler None
In all of these examples, you must set up DocumentRoot so that Apache can know where you store the bits of the static file