Fix usage of installed static media from extensions in production.
Review Request #5641 — Created March 17, 2014 and submitted
There were some issues locating static media files installed by an
extension when in a production (non-DEBUG) environment. The generated
output filename was missing the "ext/" prefix where the static media is
installed, causing an error when attempting to reference the media file.It can be very difficult to disable an extension if the media files
couldn't be found. This was because any failure to locate static media
would bubble up, causing an HTTP 500. We now sandbox these attempts and
log the failure, allowing the page to work again (at least, as well as
it can without those media files).To fix some of the confusing bits around our code, I've also finally
nukedEXTENSIONS_STATIC_ROOT
, which is really just going to be
MEDIA_ROOT/ext/
anyway. The name was confusing, as was the purpose. We
just useMEDIA_ROOT/ext/
now.
Installed an extension from an egg in production mode. Saw that the files
ended up in the correct place, and could be properly loaded on the page.Nuked the files and reloaded the page. I got errors in the log about not
finding the extension's files, but the page still loaded.