Weak formulation of Poisson with quadratic term

Hello there,

I am still relatively new to fenics and am currently trying to apply the weak formulation to nonlinear equations. How do i get to the weak formulation of a poissonlike equation, with a nonlinearity in the source function? For example i would like to solve

\Delta \phi = \rho^2.

With a given \phi, how do i have to formulate this to be able to solve for \rho?

Thank you all in advance.

Set up a non-linear problem of the form:

from dolfin import *
mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, "CG", 1)
rho = Function(V)
phi = Function(V)
v = TestFunction(V)
F = rho**2*v*dx + inner(grad(phi), grad(v))*dx 
solve(F==0, rho)