5👍
✅
In the DetailView
, you’ll be able to access the object with self.object
. Therefore you should do:
context['title'] = self.object.nick_name
However, you might find it easier to simply access the nickname via the object in the template:
{{ object.nickname }}
Source:stackexchange.com