This is a horrible practice. Better to use

 the_media_root = getattr(settings, 'SECURE_MEDIA_ROOT', None)