dns.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:oniongate-web 作者: DonnchaC 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号