Instead of solving the OP's problem directly, we will prove a general proposition and apply it to the problem. In the following proof, we will borrow an idea of Hartshorne's algebraic geometry.
Let $A = K[x, y]$. Let $f(x, y) \in K[x, y]$ be an irreducible polynomial such that $f(0, 0) = 0$. Let $\mathfrak{a} = (x, y)$, $\mathfrak{b} = (f(x, y))$. Since $f(0, 0) = 0$, $\mathfrak{b} \subset \mathfrak{a}$. Let $R = A/\mathfrak{b}$. Let $R_{\mathfrak{p}}$ be the localization of $R$ at $\mathfrak{p} = \mathfrak{a}/\mathfrak{b}$. Let $\mathfrak{m}$ be the maximal ideal of $R_{\mathfrak{p}}$.
Let $J_0(f) = (\frac{\partial f}{\partial x}(0),\frac{\partial f}{\partial y}(0))$. We regard $J_0(f)$ as a $(1, 2)$-matrix. We will prove that $R_{\mathfrak{p}}$ is a discrete valuation ring if and only if rank $J_0(f) = 1$. The OP's problem can be solved immediately by this result.
We define a linear map $\theta\colon A \rightarrow K^2$ by $\theta(F) = (\frac{\partial F}{\partial x}(0),\frac{\partial F}{\partial y}(0))$. Since $\theta(x) = (1, 0)$, $\theta(y) = (0, 1)$, $\theta$ is surjective. Since $\theta(\mathfrak{a}^2) = 0$, $\theta$ induces a surjective linear map $\bar\theta: \mathfrak{a}/\mathfrak{a}^2 \rightarrow K^2$. Since dim$_K \mathfrak{a}/\mathfrak{a}^2 = 2$, this map is an isomorphism. Then $\theta(\mathfrak{b})$ is isomorphic to $(\mathfrak{b} + \mathfrak{a}^2)/\mathfrak{a}^2$. Since dim$_K \theta(\mathfrak{b}) =$ rank $J_0(f)$, rank $J_0(f) =$ dim$_K (\mathfrak{b} + \mathfrak{a}^2)/\mathfrak{a}^2$
It is easy to see that $\mathfrak{m}/\mathfrak{m}^2 \approx \mathfrak{a}/(\mathfrak{b} + \mathfrak{a}^2)$
Hence dim $\mathfrak{m}/\mathfrak{m}^2 +$ rank $J_0(f) =$ dim$_K \mathfrak{a}/\mathfrak{a}^2 = 2$.
Hence dim $\mathfrak{m}/\mathfrak{m}^2 = 1$ if and only if rank $J_0(f) = 1$. By Nakayama's lemma, this is equivalent to that $\mathfrak{m}$ is prinicipal. Hence this is equivalent to that $R_{\mathfrak{p}}$ is a discrete valuation ring(e.g. Atiyah-MacDonald).