We have performed a calculation of the γp → π + π − p reaction, where the two pions have been separated in D-wave producing the f2(1270) resonance. We use elements of the local hidden gauge approach that provides the interaction of vector mesons in which the f2(1270) resonance appears as a ρ-ρ molecular state in L = 0 and spin 2. The vector meson dominance, incorporated in the local hidden gauge approach converts a photon into a ρ 0 meson and the other meson connects the photon with the proton. The picture is simple and has no free parameters, since the parameters of the theory have been constrained in the previous study of the vector-vector states. In a second step we introduce new elements, not present in the local hidden gauge approach, adapting the ρ propagator to Regge phenomenology and introducing the ρN N tensor coupling. We find that both the differential cross section as well as the t dependence of the cross section are in good agreement with the experimental results and provide support for the molecular picture of the f2(1270) in the first baryonic reaction where it has been tested.