staticfiles.storage.ManifestStaticFilesStorage

class storage.ManifestStaticFilesStorage A subclass of the StaticFilesStorage storage backend which stores the file names it handles by appending the MD5 hash of the file’s content to the filename. For example, the file css/styles.css would also be saved as css/styles.55e7cbb9ba48.css. The purpose of this storage is to keep serving the old files in case some pages still refer to those files, e.g. because they are cached by you or a 3rd party proxy server. Additionally, it’s very helpful if y

staticfiles.storage.CachedStaticFilesStorage

class storage.CachedStaticFilesStorage CachedStaticFilesStorage is a similar class like the ManifestStaticFilesStorage class but uses Django’s caching framework for storing the hashed names of processed files instead of a static manifest file called staticfiles.json. This is mostly useful for situations in which you don’t have access to the file system. If you want to override certain options of the cache backend the storage uses, simply specify a custom entry in the CACHES setting named 'st

sites.shortcuts.get_current_site()

shortcuts.get_current_site(request) A function that checks if django.contrib.sites is installed and returns either the current Site object or a RequestSite object based on the request. It looks up the current site based on request.get_host() if the SITE_ID setting is not defined. Both a domain and a port may be returned by request.get_host() when the Host header has a port explicitly specified, e.g. example.com:80. In such cases, if the lookup fails because the host does not match a record i

sites.requests.RequestSite.__init__()

__init__(request) Sets the name and domain attributes to the value of get_host().

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

sites.models.Site.name

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

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

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.middleware.CurrentSiteMiddleware

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

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