In this paper we present a model for accelerated expansion of the universe, both during inflation and the present stage of the expansion, from four dimensional 𝒩 = 1 supergravity. We evaluate the tensor-to-scalar ratio (r ≈ 0.00034), the scalar spectral index (ns ≈ 0.970) and the running spetral index (dns/dk ≈ −6 × 10−5), and we notice that these parameters are in agreement with Planck+WP+lensing data and with BICEP2/Keck and Planck joint analysis, at 95% CL. The number of e-folds is 50 or higher. The reheating period has an associated temperature TR ˜ 1012 GeV, which agrees with the one required by thermal leptogenesis. Regarding the scalar field as dark energy, the autonomous system for it in the presence of a barotropic fluid provides a stable fixed point that leads to a late-time accelerated expansion of the universe, with an equation of state that mimics the cosmological constant (ωΦ ≈ −0.997).