  We perform a generalized Scherk-Schwarz dimensional reduction of Double Field
Theory on a twisted double torus. The four dimensional effective action is
shown to exactly reproduce the bosonic electric sector of gauged N = 4
supergravity. We present explicit expressions for the gaugings in terms of the
twists, and analyze the associated string backgrounds. This framework provides
a higher dimensional origin of the gaugings in terms of generalized fluxes.
