#15199: Allow MEDIA_ROOT inside STATIC_ROOT
------------------------------------------------------+---------------------
               Reporter:  brutasse                    |         Owner:     
                 Status:  new                         |     Milestone:  1.3
              Component:  django.contrib.staticfiles  |       Version:  SVN
             Resolution:                              |      Keywords:     
           Triage Stage:  Unreviewed                  |     Has patch:  1  
    Needs documentation:  0                           |   Needs tests:  0  
Patch needs improvement:  1                           |  
------------------------------------------------------+---------------------

Comment (by brutasse):

 Hmmm this is trickier. With the patch applied, the media files aren't
 served by staticfiles but defining a custom view won't work either.

 {{{
 urlpatterns += patterns('django.contrib.staticfiles.views',
     url(r'^static/media/(?P<path>.*)$', 'serve',
         {'document_root': settings.MEDIA_ROOT}),
 )
 }}}

 The 'serve' view is called, but the options dict is not passed to the
 view. 'document_root' is swallowed somewhere and ends up as None in the
 view, something bad probably happens in the staticfiles handler. If I
 change MEDIA_URL to '/static_media/' and the URL pattern to
 {{{r'^static_media/(?P<path>.*)$'}}}, the options dict is correctly passed
 to the view.

 I thought modifying _should_handle() on !StaticFilesHandler would do the
 job, but apparently it's not enough. The staticfiles handler isn't
 transparently giving the control back to the parent WSGIHandler if
 _should_handle returns false.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15199#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to