We discuss an idea to realize a spontaneous current in a superfluid Fermi gas. When a polarized Fermi superfluid (N ↑ > N ↓ , where N σ is the number of atoms in the hyperfine state described by pseudospin σ =↑, ↓.) is loaded onto a ring-shaped trap with a weak potential barrier, some of excess atoms (∆N = N ↑ −N ↓ ) are localized around the barrier. As shown in our previous paper [T.Kashimura, S. Tsuchiya, and Y. Ohashi, Phys. Rev. A 82, 033617 (2010)], this polarized potential barrier works as a π-junction in the sense that the superfluid order parameter changes its sign across the barrier. Because of this, the phase of the superfluid order parameter outside the junction is shown to be twisted by π along the ring, which naturally leads to a circulating supercurrent. While the ordinary supercurrent state is obtained as a metastable state, this spontaneous current state is shown to be more stable than the case with no current. Our results indicate that localized excess atoms would be useful for the manipulation of the superfluid order parameter in cold Fermi gases.