Django static media files are not coming through

I cannot, for the life of me, get my static media files to come through on my local test machine in one particular project, though I've had no problem with a few other Django projects.

I'm using Django 1.1.1 and a Windows XP environment.

My looks like this for the media-hosting stuff:

ROOT_PATH = os.path.dirname(__file__)
# Absolute path to the directory that holds media.
# Example: "/home/media/"
MEDIA_ROOT = os.path.join(ROOT_PATH, 'site_media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "", ""
MEDIA_URL = '/site_media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "", "/media/".

And it's looking in here:

And the file is in the site directory along the lines of this:


But for some reason the image still ain't showing up.

Any advice?


Your media root should be fully specified; define your MEDIA_ROOT as follows.

ROOT_PATH = os.path.dirname(__file__)
MEDIA_ROOT = os.path.join(ROOT_PATH, 'site_media')

Did you read this documentation about static files; you should also add extra route configuration to your to make sure that requests to the static content are handled correctly.

(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
        {'document_root': settings.MEDIA_ROOT}),

Need Your Help

Programmatically lock iPhone screen in iOS 7

iphone ios objective-c ios7

I know that we can call GSEventLockDevice (); from the GraphicsServices.framework to lock the screen in iOS 6 and older version, as explained by H2CO3 Here. But unfortunately it's not working in iO...

SVG features supported in iOS

ios html5 svg

I can't seem to find a good list of SVG features supported in iOS, the best I got is this: