  Self-orthogonal codes are an important subclass of linear codes which have
nice applications in quantum codes and lattices. It is known that a binary
linear code is self-orthogonal if its every codeword has weight divisible by
four, and a ternary linear code is self-orthogonal if and only if its every
codeword has weight divisible by three. It remains open for a long time to
establish the relationship between the self-orthogonality of a general $q$-ary
linear code and the divisibility of its weights, where $q=p^m$ for a prime $p$.
In this paper, we mainly prove that any $p$-divisible code containing the all-1
vector over the finite field $\mathbb{F}_q$ is self-orthogonal for odd prime
$p$, which solves this open problem under certain conditions.
  Thanks to this result, we characterize that any projective two-weight code
containing the all-1 codeword over $\mathbb{F}_q$ is self-orthogonal.
Furthermore, by the extending and augmentation techniques, we construct six new
families of self-orthogonal divisible codes from known cyclic codes. Finally,
we construct two more families of self-orthogonal divisible codes with locality
2 which have nice application in distributed storage systems.
