#29570: Document that MEDIA_URL inside STATIC_URL leads to unexpected behaviour 
in
the development server
-----------------------------------------------+------------------------
               Reporter:  Alejandro Dubrovsky  |          Owner:  nobody
                   Type:  Bug                  |         Status:  new
              Component:  Documentation        |        Version:  2.0
               Severity:  Normal               |       Keywords:
           Triage Stage:  Unreviewed           |      Has patch:  1
    Needs documentation:  0                    |    Needs tests:  0
Patch needs improvement:  0                    |  Easy pickings:  1
                  UI/UX:  0                    |
-----------------------------------------------+------------------------
 Setting a MEDIA_URL that is within STATIC_URL, eg

 '''
 STATIC_URL = '/static/'
 MEDIA_URL = os.path.join(STATIC_URL, 'upped') + '/'
 '''
 leads to the development server refusing to serve media files when
 staticfiles is installed even if a URL route is specified since the
 staticfiles.handlers.StaticFilesHandler takes over.

 While there is a check in staticfiles warning that MEDIA_URL should not be
 equals to STATIC_URL, it does not warn about the cases where STATIC_URL is
 a prefix of MEDIA_URL. This also does not seem to be documented anywhere
 that I've seen.

 The suggestion to allow this seems to have been closed wontfix in
 https://code.djangoproject.com/ticket/15199 so I won't attempt a patch.
 Adding a check for this case does seem easy though, and I've attached a
 patch that adds a warning to this ticket. The documentation could also
 mention that adding an explicit url pattern for static and running
 ```python manage.py runserver --nostatic``` can be used as a workaround.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29570>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.ffa52699b3cffb495f85f23a7605e1fb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to