def build_zone_base_template(zone):
"""
Load template files from the zone file directory and create the base NS and static records
"""
template_data = []
zone_dir = current_app.config['zone_dir']
base_template = read_if_exists(os.path.join(zone_dir, 'base_zone.j2'))
if base_template:
template_data.append(base_template)
zone_template = read_if_exists(os.path.join(zone_dir, '{}.zone.j2'.format(zone)))
if zone_template:
template_data.append(zone_template)
template = '\n'.join(template_data)
# Use Markup to mark the string as safe, we're not generating HTML
return render_template_string(Markup(template), origin=zone)
评论列表
文章目录