class Sitemap  
A Sitemap class can define the following methods/attributes:  
items  
Required. A method that returns a sequence or QuerySet of objects. The framework doesn’t care what type of objects they are; all that matters is that these objects get passed to the location(), lastmod(), changefreq() and priority() methods. 
  
location  
Optional. Either a method or attribute. If it’s a method, it should return the absolute path for a given object as returned by items(). If it’s an attribute, its value should be a string representing an absolute path to use for every object returned by items(). In both cases, “absolute path” means a URL that doesn’t include the protocol or domain. Examples:  Good: '/foo/bar/'
 Bad: 'example.com/foo/bar/'
 Bad: 'https://example.com/foo/bar/'
  If location isn’t provided, the framework will call the get_absolute_url() method on each object as returned by items(). To specify a protocol other than 'http', use protocol. 
  
lastmod  
Optional. Either a method or attribute. If it’s a method, it should take one argument – an object as returned by items() – and return that object’s last-modified date/time as a datetime. If it’s an attribute, its value should be a datetime representing the last-modified date/time for every object returned by items(). If all items in a sitemap have a lastmod, the sitemap generated by views.sitemap() will have a Last-Modified header equal to the latest lastmod. You can activate the ConditionalGetMiddleware to make Django respond appropriately to requests with an If-Modified-Since header which will prevent sending the sitemap if it hasn’t changed. 
  
paginator  
Optional. This property returns a Paginator for items(). If you generate sitemaps in a batch you may want to override this as a cached property in order to avoid multiple items() calls. 
  
changefreq  
Optional. Either a method or attribute. If it’s a method, it should take one argument – an object as returned by items() – and return that object’s change frequency as a string. If it’s an attribute, its value should be a string representing the change frequency of every object returned by items(). Possible values for changefreq, whether you use a method or attribute, are:  'always' 'hourly' 'daily' 'weekly' 'monthly' 'yearly' 'never'  
  
priority  
Optional. Either a method or attribute. If it’s a method, it should take one argument – an object as returned by items() – and return that object’s priority as either a string or float. If it’s an attribute, its value should be either a string or float representing the priority of every object returned by items(). Example values for priority: 0.4, 1.0. The default priority of a page is 0.5. See the sitemaps.org documentation for more. 
  
protocol  
Optional. This attribute defines the protocol ('http' or 'https') of the URLs in the sitemap. If it isn’t set, the protocol with which the sitemap was requested is used. If the sitemap is built outside the context of a request, the default is 'http'.  Deprecated since version 4.0: The default protocol for sitemaps built outside the context of a request will change from 'http' to 'https' in Django 5.0.  
  
limit  
Optional. This attribute defines the maximum number of URLs included on each page of the sitemap. Its value should not exceed the default value of 50000, which is the upper limit allowed in the Sitemaps protocol. 
  
i18n  
Optional. A boolean attribute that defines if the URLs of this sitemap should be generated using all of your LANGUAGES. The default is False. 
  
languages  
 New in Django 3.2.  Optional. A sequence of language codes to use for generating alternate links when i18n is enabled. Defaults to LANGUAGES. 
  
alternates  
 New in Django 3.2.  Optional. A boolean attribute. When used in conjunction with i18n generated URLs will each have a list of alternate links pointing to other language versions using the hreflang attribute. The default is False. 
  
x_default  
 New in Django 3.2.  Optional. A boolean attribute. When True the alternate links generated by alternates will contain a hreflang="x-default" fallback entry with a value of LANGUAGE_CODE. The default is False.