import requests


def load_template_from_url(url):
    """Load a Jinja2 template from a URL"""
    # fetch the template from the URL as a string
    response = requests.get(url)
    if response.status_code != 200:
        raise Exception(
            "Could not fetch the configuration template from the URL {}".format(
                url
            )
        )
    return response.text