﻿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
15199	Allow MEDIA_ROOT inside STATIC_ROOT	Bruno Renié		"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)."		closed	contrib.staticfiles	dev		wontfix	blocker		Accepted	1	0	0	1	0	0
