serve user-uploaded media with the dev server #39

Merged
merged 1 commit into from Mar 8, 2012
Jump to file or symbol
Failed to load files and symbols.
+6 −3
Diff settings

Always

Just for now

@@ -1,6 +1,7 @@
from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
+from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
@@ -26,4 +27,4 @@
if settings.SERVE_MEDIA:
urlpatterns += patterns("",
url(r"", include("staticfiles.urls")),
- )
+ ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
@@ -1,6 +1,7 @@
from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
+from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
@@ -29,4 +30,4 @@
if settings.SERVE_MEDIA:
urlpatterns += patterns("",
url(r"", include("staticfiles.urls")),
- )
+ ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
@@ -1,6 +1,7 @@
from django.conf import settings
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
+from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
@@ -20,4 +21,4 @@
if settings.SERVE_MEDIA:
urlpatterns += patterns("",
url(r"", include("staticfiles.urls")),
- )
+ ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)