  We investigate the gauging of the Wess-Zumino term of a sigma model with
boundary. We derive a set of obstructions to gauging and we interpret them as
the conditions for the Wess-Zumino term to extend to a closed form in a
suitable equivariant relative de Rham complex. We illustrate this with the
two-dimensional sigma model and we show that the new obstructions due to the
boundary can be interpreted in terms of Courant algebroids. We specialise to
the case of the Wess-Zumino-Witten model, where it is proved that there always
exist suitable boundary conditions which allow gauging any subgroup which can
be gauged in the absence of a boundary. We illustrate this with two natural
classes of gaugings: (twisted) diagonal subgroups with boundary conditions
given by (twisted) conjugacy classes, and chiral isotropic subgroups with
boundary conditions given by cosets.
