We elucidate the structure of D terms in N=1 orientifold compactifications
with fluxes. As a case study, we consider a simple orbifold of the type-IIA
theory with D6-branes at angles, O6-planes and general NSNS, RR and
Scherk-Schwarz geometrical fluxes. We examine in detail the emergence of D
terms, in their standard supergravity form, from an appropriate limit of the
D-brane action. We derive the consistency conditions on gauged symmetries and
general fluxes coming from brane-localized Bianchi identities, and their
relation with the Freed-Witten anomaly. We extend our results to other N=1
compactifications and to non-geometrical fluxes. Finally, we discuss the
possible role of U(1) D terms in the stabilization of the untwisted moduli from
the closed string sector.Comment: 1+31 pages, 1 figur