The weak radiative Cabibbo allowed decays D^+ -> anti K^0 pi^+ gamma and D^0 -> K^- pi^+ gamma with nonresonant K pi are investigated by relying on the factorization approximation for the nonleptonic weak transitions and the model which combines the heavy quark effective theory and the chiral Lagrangian approach. The dominant contributions to the amplitudes come from the long distance effects. The decay amplitude has both parity violating and parity conserving parts. The parity violating part includes also a bremsstrahlung contribution. The branching ratio obtained for the parity conserving part is of the order 10^-4 for the D^0 -> K^- pi^+ gamma decay and 10^-5 for the D^+ -> anti K^0 pi^+ gamma, when the effect of light vector mesons is included, and smaller otherwise. The branching ratio for the parity violating part with a photon energy cut of 50 MeV, is close to 10^-3 for the D^0 decay and 4x10^-4 for the D^+ decay. We present Dalitz plots and energy spectra for both transitions as derived from our model and we probe the role of light vector mesons in these decays.