Nonlinear periodic systems, such as photonic crystals and Bose-Einstein condensates (BECs) loaded into optical lattices, are often described by the nonlinear Schrodinger/Gross-Pitaevskii equation with a sinusoidal potential. Here, we consider a model based on such a periodic potential, with the nonlinearity (attractive or repulsive) concentrated either at a single point or at a symmetric set of two points, which are represented, respectively, by a single {delta}-function or a combination of two {delta}-functions. This model gives rise to ordinary solitons or gap solitons (GSs), which reside, respectively, in the semi-infinite or finite gaps of the systems linear spectrum, being pinned to the {delta}-functions. Physical realizations of these systems are possible in optics and BEC, using diverse variants of the nonlinearity management. First, we demonstrate that the single {delta}-function multiplying the nonlinear term supports families of stable regular solitons in the self-attractive case, while a family of solitons supported by the attractive {delta}-function in the absence of the periodic potential is completely unstable. We also show that the {delta}-function can support stable GSs in the first finite gap in both the self-attractive and repulsive models. The stability analysis for the GSs in the second finite gap is reported too, for both signs of the nonlinearity. Alongside the numerical analysis, analytical approximations are developed for the solitons in the semi-infinite and first two finite gaps, with the single {delta}-function positioned at a minimum or maximum of the periodic potential. In the model with the symmetric set of two {delta}-functions, we study the effect of the spontaneous symmetry breaking of the pinned solitons. Two configurations are considered, with the {delta}-functions set symmetrically with respect to the minimum or maximum of the potential.