  We study the Daugavet property in the space of Lipschitz functions
$\operatorname{Lip}_0(M)$ for a complete metric space $M$. Namely we show that
$\operatorname{Lip}_0(M)$ has the Daugavet property if and only if $M$ is a
length space. This condition also characterises the Daugavet property in the
Lipschitz free space $\mathcal{F}(M)$. Moreover, when $M$ is compact, we show
that either $\mathcal{F}(M)$ has the Daugavet property or its unit ball has a
strongly exposed point. If $M$ is an infinite compact subset of a strictly
convex Banach space then the Daugavet property of $\operatorname{Lip}_0(M)$ is
equivalent to the convexity of $M$.
