Permalink
Browse files

serve user-uploaded media with the dev server

We should serve up user-uploaded stuff when running the dev server
  • Loading branch information...
1 parent 310c894 commit 53c6b582305d2600bd5a618a51e0fc479bfbf77c @tubaman tubaman committed Jan 21, 2012
@@ -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)

0 comments on commit 53c6b58

Please sign in to comment.