A general method is presented for constructing distribution functions for flat systems whose surface density and Toomre Q number profile are given. The purpose of these functions is to provide plausible galactic models and assess their critical stability with respect to global non-axisymmetric modes. The derivation may be carried out for an azimuthal velocity distribution (or a given specific energy distribution) which may either be observed or be chosen to match a specified temperature profile. Distribution functions describing stable models with realistic velocity distributions for power-law discs, the isochrone and the Kuzmin discs are provided. Specially simple inversion formulae are also given for finding distribution functions for flat systems the surface densities of which are known.