  Part I of this paper deals with two-dimensional canonical systems
$y'(x)=zJH(x)y(x)$, $x\in(a,b)$, whose Hamiltonian $H$ is non-negative and
locally integrable, and where Weyl's limit point case takes place at both
endpoints $a$ and $b$. We investigate a class of such systems defined by growth
restrictions on $H$ towards $a$. We develop a direct and inverse spectral
theory parallel to the theory of Weyl and de Branges for systems in the limit
circle case at $a$. Our approach proceeds via -- and is bound to -- Pontryagin
space theory. It relies on spectral theory and operator models in such spaces,
and on the theory of de Branges Pontryagin spaces.
  The main results concerning the direct problem are: (1) showing existence of
regularized boundary values at $a$; (2) construction of a singular Weyl
coefficient and a scalar spectral measure; (3) construction of a Fourier
transform and computation of its action and the action of its inverse as
integral transforms. The main results for the inverse problem are: (4)
characterization of the class of measures that are obtained via the above
construction (positive Borel measures with power growth at $\pm\infty$); (5) a
global uniqueness theorem (if Weyl functions or spectral measures coincide,
Hamiltonians essentially coincide); (6) a local uniqueness theorem.
  In Part II of the paper the results of Part I are applied to Sturm--Liouville
equations with singular coefficients. We investigate classes of equations
without potential (in particular, equations in impedance form) and
Schr\"odinger equations, where coefficients are assumed to be singular but
subject to growth restrictions. We obtain corresponding direct and inverse
spectral theorems.
