url(r'^users/([0-9]+)/', ProfileView.Detail.as_view()),
class Detail(DetailView): model = Profile template_name = "home.html" context_object_name = 'profile' # по умолчанию object или objects def get_context_data(self, *args, **kwargs): context = super(Detail, self).get_context_data(*args, **kwargs) context['header'] = "Профиль" return context
Generic detail view Detail must be called with either an object pk or a slug.
url(r'^users/(?P<pk>[0-9]+)/', ProfileView.Detail.as_view()),