Created
March 20, 2009 12:00
-
-
Save bradwright/82335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# settings.py | |
# go up two levels | |
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), '../../www/') | |
# in bottom of urls.py | |
# this is for serving static files in development | |
if settings.DEBUG: | |
import os | |
# get the static path from settings | |
static_url = settings.MEDIA_URL | |
if static_url.startswith('/'): | |
static_url = static_url.lstrip('/') | |
urlpatterns += patterns('', | |
( | |
r'^%s(?P<path>.*)$' % static_url, | |
'django.views.static.serve', | |
{ | |
'document_root': settings.MEDIA_ROOT | |
} | |
), | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment