django-class-based-views

What is context_object_name in django views?


I'm new to django. And now I'm studying using the class-based generic views. Could someone please explain the aim and use of context_object_name attribute?


Solution

  • Ok, I've got it by myself! :)

    It's just a human-understandable name of variable to access from templates

    https://docs.djangoproject.com/en/stable/topics/class-based-views/generic-display/#making-friendly-template-contexts