Always name your patterns. It helps in decoupling your code from the exact URL paths. For instance, in the previous URLConf, if you want to redirect to the About page, it might be tempting to use redirect("/about"). Instead, use redirect("about"), as it uses the name rather than the path.
Here are some more examples of reverse lookups:
>>> from django.urls import reverse >>> reverse("hello_fn") /hello-fn/ >>> reverse("year_view", kwargs={"year":"793"}) /year/793/
Names must be unique. If two patterns have the same name, they will not work. Earlier, some Django packages used to add prefixes to the pattern name. For example, an application named Blog might have to call its feed view blog-feed since feed is a common name ...