First of all, when it comes to web development you really want to avoid hard coding paths in your templates. The reason for this is that paths might change, and it will be a hassle to go through all your HTML and templates to find every single URL or path and update it manually. It makes your code much harder to maintain.
The solution to this is to define functions that return the URL instead. This is where get_absolute_url()
comes into the picture.
Example:
<!-- Bad -->
<a href="/language/category/product/{{product.pk}}">Link</a>
<!-- Good -->
<a href="{{product.get_absolute_url}}">Link</a>
Canonical URL
Your second question is what a canonical URL is. A canonical URL is "the official" url to a certain page. Sometimes an asset can be displayed in multiple different URL's, for example:
/en/shoes/1-nike-shoes/
/en/shoes/1-nike-shoes?sort=price&order=asc
/en/shoes/1-nike-shoes?sort=price&order=desc
Here we have the same asset displayed in 3 different URL's. The "Canonical URL" would be the one we defined as the main one. E.g. /en/shoes/1-nike-shoes/
.
Its very useful to define what a official or "main" URL to a certain asset is. It will allow you to prevent duplicate content when search engines index your website.
In the context of the quote you are using from the Django Documentation. "Canonical" in this case means "the official URL where this model is displayed".