A method is presented for maximising the total capacity of distributed generation which a network can support, using a Security Constrained AC Optimal Power Flow (SCOPF). The motivation behind this model is to assess the network's capacity for new generation. Differently from the classical OPF, where generation cost is minimised, the objective function maximises the total capacity of the proposed DG sites that can be accommodated without breaching transmission constraints. Unlike previous work, a secure OPF including line outage contingencies is used, in order to ensure that the resulting DG capacities maintain the relevant network security standard. The resulting mathematical program is solved by iteratively adding the most severe contingencies and using warm starts to speed up the solution of the resulting OPFs. The results presented are based on a modified IEEE 73-bus Reliability Test System with N-1 security - however the method is generic and can be used at other voltage levels and with reconfiguration-based security models. Issues arising from the non-convexity of the AC OPF are also discussed.