Previous Page Next Page

Q&A

Q.Does Django use the sites framework internally?
A.Yes. The following list describes some of the ways Django uses the sites framework:
  • The redirects framework associates a redirect object to a particular site. Django uses the SITE_ID setting when searching for redirects.

  • The authentication framework passes the Site object name to the django.contrib.auth.views.login view as the variable {{ site_name }}.

  • The sitemaps framework uses the domain from the current Site object to fill in the location attributes in the sitemap.

  • The admin framework uses the current Site object to determine which domain the view or site link is redirected to.

  • The comments framework uses the sites framework to tie comments to the current SITE_ID setting.

  • The flatpages framework links the flatpage to specific sites and then uses the SITE_ID setting when displaying the flatpages.

  • The django.views.defaults.shortcut view uses the domain of the current Site object to calculate the object's URL.

  • The syndication framework gives the title and description templates access to the current Site object using the variable {{ site }}.

Previous Page Next Page