The problem with doing this is that in dev and staging, settings.MEDIA_URL is '/media/', so a URL starting with /media/ will work, but in production the MEDIA_URL is pointing to the CDN without starting with /media/, so the result will be a 404 in production for the media. @pmclanahan and I agree that this function should not be changed in this way.