Makes a filesystem path from the specified URL path

def _get_filesystem_path(self, url_path, basedir=settings.MEDIA_ROOT):
        """Makes a filesystem path from the specified URL path"""

        if url_path.startswith(settings.MEDIA_URL):
            url_path = url_path[len(settings.MEDIA_URL):]  # strip media root url

        return os.path.normpath(os.path.join(basedir, url2pathname(url_path)))