def upload_app_static_media(self): for root_dir in utils.app_static_media_dirs(): for dirpath, dirs, files in os.walk(root_dir): for filename in files: path = os.path.join(dirpath, filename) s3_path = os.path.relpath(path, root_dir) self.upload_file(path, s3_path)
def serve_add_static_media(request, path): for root_dir in utils.app_static_media_dirs(): if os.path.exists(os.path.join(root_dir, path)): return static.serve(request, path, document_root=root_dir) raise Http404("'%s' could not be found" % path)