urls.py
-------------------------
from django.conf import settings
# Serves media content. WARNING!! Only for development uses.
# On production use lighthttpd for media content.
if settings.DEBUG:
# Delete the first trailing slash, if any.
if settings.MEDIA_URL.startswith('/'):
media_url = settings.MEDIA_URL[1:]
else:
media_url = settings.MEDIA_URL
# Add the last trailing slash, if have not.
if not media_url.endswith('/'):
media_url = media_url + '/'
urlpatterns += patterns('',
(r'^' + media_url + '(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}
),
)
-------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---