A stochastic minimization method for a real-space wave function, Ψ(r, r...r ), constrained to a chosen density, ρ(r), is developed. It enables the explicit calculation of the Levy constrained search, F[ρ] = min⟨Ψ| T̂ + V̂ |Ψ⟩, which gives the exact functional of density functional theory. This general method is illustrated in the evaluation of F[ρ] for densities in one dimension with a soft-Coulomb interaction. Additionally, procedures are given to determine the first and second functional derivatives, δ F/δρ(r) and δ F/[δρ(r)δρ(r')]. For a chosen external potential, v(r), the functional and its derivatives are used in minimizations over densities to give the exact energy, E , without needing to solve the Schrödinger equation.