So I am asked to fit a logit model using the method of least squares in connection to logistic regression. Let $\pi(x)=\mathrm{P}(Y=1|X=x)$ be the probability of success of a binary response variable $Y$ for a given $x$. Then it is established from the differential equation $d(\pi(x))=\beta\,\pi(x)(1-\pi(x))dx$ that the logistic curve is of the form $\pi(x)=\dfrac{e^{\alpha+\beta x}}{1+e^{\alpha+\beta x}}$.
It is also seen while solving the above differential equation that it is the logit $\ln \left(\frac{\pi(x)}{1-\pi(x)}\right)=\alpha+\beta x$ which is actually linear. So could I use the conventional least square method for this function and obtain the least square estimates $\hat{\alpha},\hat{\beta}$ to substitute for $\alpha,\beta$ in the fitted curve $\hat{\pi(x)}$? Is this what I am supposed to do? Or is there a different principle to be followed for fitting the logit model, something like the weighted least squares?