#15199: Allow MEDIA_ROOT inside STATIC_ROOT
----------------------------------------+-----------------------------------
 Reporter:  brutasse                    |          Owner:            
   Status:  new                         |      Milestone:  1.3       
Component:  django.contrib.staticfiles  |        Version:  SVN       
 Keywords:                              |   Triage Stage:  Unreviewed
Has patch:  0                           |  
----------------------------------------+-----------------------------------
 I have the following layout:

 {{{
 STATIC_ROOT = '/path/to/static/'
 STATIC_URL = '/static/'

 MEDIA_ROOT = STATIC_ROOT + 'media/'
 MEDIA_URL = STATIC_URL + 'media/'
 }}}

 Basically, MEDIA_ROOT is a subdirectory of STATIC_ROOT.

 With runserver, I won't be able to serve my media files. When I try to
 fetch a media file, the !StaticFilesHandler tries to handle it (since its
 URL starts with STATIC_URL) but no finder will be able to resolve its
 path.

 The handler then raises a 404  even if I have a pattern in my urlconf to
 serve my media files.

 After discussing it on IRC, it looks like two things are needed to support
 this:

 * Patch the contrib.staticfiles handler to specifically ignore anything
 inside MEDIA_URL

 * Add extra checks to the collectstatic management command to make sure
 collectstatic won't write anything inside MEDIA_ROOT (which could
 potentially overwrite some user data).

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15199>
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