We present a new approach to the modelling of stress propagation in static granular media, focussing on the conical sandpile constructed from a point source. We view the medium as consisting of cohesionless hard particles held up by static frictional forces; these are subject to microscopic indeterminacy which corresponds macroscopically to the fact that the equations of stress continuity are incomplete -no strain variable can be defined. We propose that in general the continuity equations should be closed by means of a constitutive relation (or relations) between different components of the (mesoscopically averaged) stress tensor. The primary constitutive relation relates radial and vertical shear and normal stresses (in two dimensions, this is all one needs). We argue that the constitutive relation(s) should be local, and should encode the construction history of the pile: this history determines the organization of the grains at a mesoscopic scale, and thereby the local relationship between stresses. To the accuracy of published experiments, the pattern of stresses beneath a pile shows a scaling between piles of different heights (RSF scaling) which severely limits the form the constitutive relation can take; various asymptotic features of the stress patterns can be predicted on the basis of this scaling alone. To proceed further, one requires an explicit choice of constitutive relation; we review some from the literature and present two new proposals. The first, the FPA (fixed principal axes) model, assumes that the eigendirections (but not the eigenvalues) of the stress tensor are determined forever when a material element is first buried. (This assumes, among other things, that subsequent loadings are not so large as to produce slip deep inside the pile.) A macroscopic consequence of this mesoscopic assumption is that the principal axes have fixed orientation in space: the major axis everywhere bisects the vertical and the free surface. As a result of this, stresses propagate along a nested set of archlike structures within the pile, resulting in a minimum of the vertical normal stress between the apex of the pile, as seen experimentally ("the dip"). This experiment has not been explained within previous continuum approaches; the appearance of arches within our model corroborates earlier physical arguments (of S. F. Edwards and others) as to the origin of the dip, and places them on a more secure mathematical footing. The second model is that of "oriented stress linearity" (OSL) which contains an adjustable parameter (one value of which corresponds to FPA). For the general OSL case, the simple interpretation in terms of nested arches does not apply, though a dip is again found over a finite parameter range. In three dimensions, the choice for the primary constitutive relation must be supplemented by a secondary one; we have tried several, and find that the results for the stresses in a three dimensional (conical) pile do not depend much on which secondary closure is chosen. Three dimensional result...