There are two options
First, add a new urlpattern to
url(r'^sitemap\.xml/$', TemplateView.as_view(template_name='sitemap.xml', c/xml')),
Second,
Directly hand it over to nginx for processing, and add the static to be processed in the nginx conf file URL and path
location /sitemap.xml { alias /path/to/static/sitemap.xml; }
Reference: http://stackoverflow.com/questions/18424260/django-serving-robots-txt -efficiently
The above introduces how to put static files such as sitemapxml in the web root directory in the Django project, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.