Site model is useful for multi-site installations as it allows an administrator to configure which part of the tree to use for each hostname that the server responds on.
This configuration is used by the Sitemiddleware middleware class which checks each request against this configuration and appends the Site object to the Django request object.
Now we learn about different type of Datebase fields and Method and properties of
This is the hostname of the site, excluding the scheme, port and path.
For example: www.mysite.com
This is the port number that the site responds on.
A human-readable name for the site. This is not used by Wagtail itself, but is suitable for use on the site front-end, such as in <title> elements.
For example: Rod's World of Birds
This is a link to the root page of the site. This page will be what appears at the / URL on the site and would usually be a homepage.
This is set to True if the site is the default. Only one site can be the default.
The default site is used as a fallback in situations where a site with the required hostname/port couldnot be found.
Methods and properties
Find the site object responsible for responding to this HTTP request object.
This returns the URL of the site. It is calculated from the
hostname and the
Return a list of (root_path, root_url) tuples, most specific path first - used to translate url_paths into actual URLs with hostnames