code: def execute(self, *args, **options):
          
          try:
              super(EmailNotificationCommand, self).execute(*args, **options)
          except Exception:
              if options['email_exception'] or getattr(self, 'email_exception', False):
                  self.send_email_notification(include_traceback=True)
              raise
docs: Overriden in order to send emails on unhandled exception.
  
          If an unhandled exception in ``def handle(self, *args, **options)``
          occurs and `--email-exception` is set or `self.email_exception` is
          set to True send an email to ADMINS with the traceback and then
          reraise the exception.