<filename>mneia_admin_export/utils.py<gh_stars>0
from pathlib import Path

from django.template.loader import render_to_string


def export_sitemap_index(models):
    export_file = Path.home() / "Code/mneia-gr.github.io/sitemap.xml"
    template_file = "mneia_admin_export/sitemap-index.xml"
    html = render_to_string(template_file, {"models": [model.get_model_slug_plural() for model in models]})
    export_file.write_text(html)
