﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29570	Add check that MEDIA_URL is not inside STATIC_URL.	Alejandro Dubrovsky	nobody	"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."	Cleanup/optimization	closed	Core (System checks)	dev	Normal	fixed		Herbert Fortes	Accepted	1	0	1	0	1	0
