Ticket #8688: static-files.diff

File static-files.diff, 598 bytes (added by arien, 16 years ago)

Patch to use settings.MEDIA_ROOT as the document_root for serving static media.

  • docs/howto/static-files.txt

     
    119119
    120120    if settings.DEBUG:
    121121        urlpatterns += patterns('',
    122             (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'}),
     122            (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    123123        )
    124124
    125125This code is straightforward. It imports the settings and checks the value of
Back to Top