code: def generate_detail_view(self):
          
  
          name = model_class_form(self.model + 'DetailView')
          detail_args = dict(
              detailview_excludes=self.detailview_excludes,
              model=self.get_model_class,
              template_name=self.get_template('detail'),
              login_required=self.check_login_required,
              permissions=self.view_permission('detail'),
              inlineformset=self.inlineformset,
              permission_required=self.check_permission_required,
              custom_postfix_url=self.custom_postfix_url
          )
  
          detail_class = type(name, (BaseDetailViewMixin, DetailView), detail_args)
          self.classes[name] = detail_class
          return detail_class
docs: Generate class based view for DetailView