def METHOD_NAME(path):
    resolved_path = path.absolute().resolve()
    docroot = Path(settings.DOCROOT).absolute()
    if not path.is_relative_to(docroot):
        log.error(
            "Suspicious operation outside the docroot directory.",
            path_resolved=str(resolved_path),
        )
        raise SuspiciousFileOperation(path)