Deriving the polar equation of a parabola with focus at the origin and directrix at $y=-p$ 
How is the following result of a parabola with focus $F(0,0)$ and directrix $y=-p$, for $p \gt 0$ reached? It is said to be $$r(\theta)=\frac{p}{1-\sin \theta} $$

I started by saying the the standard equation of a parabola, in Cartesian form is $y= \frac{x^2}{4p} $, where $p \gt 0 $ and the focus is at $F(0,p)$ and the directrix is $y=-p$. So for the question above, would the equation in Cartesian form be $$y= \frac{x^2}{4 \cdot \left(\frac{1}{2}p\right)}=\frac{x^2}{2p}?$$
I thought this because the vertex is halfway between the directrix and the focus of a parabola.
Then I tried to use the facts:
$$r^2 = x^2 +y^2 \\
x =r\cos\theta \\
y=r\sin\theta.$$
But I couldn't get the form required, any corrections, or hints?
Cheers.

For a parabola with $F(0,0)$ and directrix $y=-p$, first write a “distance equation” relating any point on the parabola, $P(x,y)$, to $F$ and to the directrix, $D$.
A parabola can be defined by its locus: $distanceFP = distanceDP$.
$distanceFP = \sqrt{(x-0)^2+(y-0)^2} = \sqrt{x^2+y^2}$
$distanceDP = y-(-p) = y+p$
So, for $P(x,y)$ on the parabola with $F(0,0)$ and directrix $y=-p$, we can write
$$\sqrt{x^2+y^2}=y+p   …(1)$$
For polar cords, we know that $x^2+y^2=r^2$, and $y=r sin\theta$
Therefore (1) becomes $$\sqrt{r^2}=r sin\theta + p$$
$$r = r sin\theta + p$$
$$r – r sin\theta = p$$
$$r(1 – sin\theta) = p$$
Hence $$r = \frac{p}{1 – sin\theta}$$
