sitemaps.Sitemap.priority

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.

sitemaps.Sitemap.protocol

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'.

sitemaps.views.index()

views.index(request, sitemaps, template_name='sitemap_index.xml', content_type='application/xml', sitemap_url_name='django.contrib.sitemaps.views.sitemap') The sitemap framework also has the ability to create a sitemap index that references individual sitemap files, one per each section defined in your sitemaps dictionary. The only differences in usage are: You use two views in your URLconf: django.contrib.sitemaps.views.index() and django.contrib.sitemaps.views.sitemap(). The django.contrib

sitemaps.views.sitemap()

views.sitemap(request, sitemaps, section=None, template_name='sitemap.xml', content_type='application/xml') To activate sitemap generation on your Django site, add this line to your URLconf: from django.contrib.sitemaps.views import sitemap url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap') This tells Django to build a sitemap when a client accesses /sitemap.xml. The name of the sitemap file is not important, but the location is. Searc

sites.managers.CurrentSiteManager

class managers.CurrentSiteManager If Site plays a key role in your application, consider using the helpful CurrentSiteManager in your model(s). It’s a model manager that automatically filters its queries to include only objects associated with the current Site. Mandatory SITE_ID The CurrentSiteManager is only usable when the SITE_ID setting is defined in your settings. Use CurrentSiteManager by adding it to your model explicitly. For example: from django.db import models from django.contri

sites.middleware.CurrentSiteMiddleware

class CurrentSiteMiddleware [source] Adds the site attribute representing the current site to every incoming HttpRequest object. See the sites documentation.

sites.models.Site

class models.Site A model for storing the domain and name attributes of a website. domain The fully qualified domain name associated with the website. For example, www.example.com. Changed in Django 1.9: The domain field was set to be unique. name A human-readable “verbose” name for the website. The SITE_ID setting specifies the database ID of the Site object associated with that particular settings file. If the setting is omitted, the get_current_site() function will try to ge

sites.models.Site.domain

domain The fully qualified domain name associated with the website. For example, www.example.com. Changed in Django 1.9: The domain field was set to be unique.

sites.models.Site.name

name A human-readable “verbose” name for the website.

sites.requests.RequestSite

class requests.RequestSite A class that shares the primary interface of Site (i.e., it has domain and name attributes) but gets its data from a Django HttpRequest object rather than from a database. __init__(request) Sets the name and domain attributes to the value of get_host(). A RequestSite object has a similar interface to a normal Site object, except its __init__() method takes an HttpRequest object. It’s able to deduce the domain and name by looking at the request’s domain. It ha