Render the given config data using Django's template system.

    This function takes a config data string and a dict of context variables,
    renders the data through Django's template system, and returns the result.

def render_config(data,ctx):
    """Render the given config data using Django's template system.

    This function takes a config data string and a dict of context variables,
    renders the data through Django's template system, and returns the result.
    """
    djsupervisor_tags.current_context = ctx
    data = "{% load djsupervisor_tags %}" + data
    t = template.Template(data)
    c = template.Context(ctx)
    return t.render(c).encode("ascii")