CONN_MAX_AGE should go inside the DATABASES setting. Doh.