1.settings.py
MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
2.urls.py
from django.views.static import serve from macboy.settings import MEDIA_ROOT url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
1.settings.py
MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
2.urls.py
from django.views.static import serve from macboy.settings import MEDIA_ROOT url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),