def check_required(settings, required):
    """Ensure ``settings`` contains the ``required`` keys."""
    missing = []
    for r in required:
        if r not in settings:
            missing.append(r)
    if missing:
        raise ValueError('Missing required settings: {}'.format(', '.join(
            missing)))
