for test server i add the following lines in settings.py
import os
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
STATIC_DOC_ROOT = os.path.join(SITE_ROOT, 'media/')
and add the following lines in urls.py
if settings.DEBUG == True:
urlpatterns += patterns('',(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.STATIC_DOC_ROOT}),)
and put all your media files in site_media folder
for my apache + mod_python setup i ve the following lines
<Location "/">
PythonHandler django.core.handlers.modpython
PythonPath "['c:/site',] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE hospital.settings
SetHandler python-program
</Location>
<Locationmatch "^/(theme|media|site_media)/.*">
SetHandler default
</Locationmatch>
alias /media/ H:/Python25/Lib/site-packages/django/contrib/admin/media/
alias /site_media/ c:/site/hospital/media/
"SetHandler default" should be after the "SetHandler python-program" in sequences