We introduce a number of improvements to the thermo-chemical
disc modelling code ProDiMo and new theoretical approaches that can
be used to better predict and analyse the JWST line spectra of
protoplanetary discs. We developed a new line escape probability
method for disc geometries, and a new scheme for dust settling, and
discuss how to apply UV molecular shielding factors to photo rates
in 2D disc geometry. We show that these assumptions are crucial for
the determination of gas heating and cooling rates and discuss how
they affect the predicted molecular concentrations and line
emissions. We apply our revised 2D models to the protoplanetary
disc around the T\,Tauri star EX\,Lupi in quiescent state. We calculate infrared line emission spectra between 5 and 20\,mu m from CO, H$_2$O, OH, CO$_2$, HCN, C$_2$H$_2$, and H$_2$, including lines of atoms and ions, using our full 2D predictions of molecular abundances, dust opacities, and gas and dust temperatures. We developed a disc model with a slowly increasing surface density structure around the inner rim that can simultaneously fit the spectral energy distribution, the overall shape of the JWST spectrum of EX\,Lupi, and the main observed molecular characteristics in terms of column densities, emitting areas, and molecular emission temperatures, which all result from one consistent disc model. The spatial structure of the line-emitting regions of the different molecules is discussed. High abundances of HCN and C2H2 are
caused in the model by stellar X-ray irradiation of the gas around
the inner rim.