def handle(self, *args, **options):
        # bind host and port
        if len(args) > 0:
            host_port = args[0]
        else:
            host_port = None
        if host_port:
            host, _port = host_port.split(':', 1)
            port = int(_port)
        else:
            host = utils.get_settings_value('FTPSERVER_HOST') or '127.0.0.1'
            port = utils.get_settings_value('FTPSERVER_PORT') or 21

        timeout = options['timeout'] \
            or utils.get_settings_value('FTPSERVER_TIMEOUT')

        # passive ports
        _passive_ports = options['passive-ports'] \
            or utils.get_settings_value('FTPSERVER_PASSIVE_PORTS')
        if _passive_ports:
            try:
                passive_ports = utils.parse_ports(_passive_ports)
            except (TypeError, __HOLE__):
                raise CommandError("Invalid passive ports: {}".format(
                    options['passive-ports']))
        else:
            passive_ports = None

        # masquerade address
        masquerade_address = options['masquerade-address'] \
            or utils.get_settings_value('FTPSERVER_MASQUERADE_ADDRESS')

        # file access user
        file_access_user = options['file-access-user'] \
            or utils.get_settings_value('FTPSERVER_FILE_ACCESS_USER')

        # certfile
        certfile = options['certfile'] \
            or utils.get_settings_value('FTPSERVER_CERTFILE')

        # keyfile
        keyfile = options['keyfile'] \
            or utils.get_settings_value('FTPSERVER_KEYFILE')

        # sendfile
        sendfile = options['sendfile'] \
            or utils.get_settings_value('FTPSERVER_SENDFILE')

        # daemonize
        daemonize = options['daemonize'] \
            or utils.get_settings_value('FTPSERVER_DAEMONIZE')
        if daemonize:
            daemonize_options = utils.get_settings_value(
                'FTPSERVER_DAEMONIZE_OPTIONS') or {}
            become_daemon(**daemonize_options)

        # write pid to file
        pidfile = options['pidfile'] \
            or utils.get_settings_value('FTPSERVER_PIDFILE')
        if pidfile:
            with open(pidfile, 'w') as f:
                f.write(str(os.getpid()))

        # select handler class
        if certfile or keyfile:
            if hasattr(handlers, 'TLS_FTPHandler'):
                handler_class = (
                    utils.get_settings_value('FTPSERVER_TLSHANDLER')
                ) or handlers.TLS_FTPHandler
            else:
                # unsupported
                raise CommandError(
                    "Can't import OpenSSL. Please install pyOpenSSL.")
        else:
            handler_class = (
                utils.get_settings_value('FTPSERVER_HANDLER')
            ) or handlers.FTPHandler

        authorizer_class = utils.get_settings_value('FTPSERVER_AUTHORIZER') \
            or FTPAccountAuthorizer

        # setup server
        server = self.make_server(
            server_class=FTPServer,
            handler_class=handler_class,
            authorizer_class=authorizer_class,
            host_port=(host, port),
            file_access_user=file_access_user,
            timeout=timeout,
            passive_ports=passive_ports,
            masquerade_address=masquerade_address,
            certfile=certfile,
            keyfile=keyfile,
            sendfile=sendfile)

        # start server
        quit_command = 'CTRL-BREAK' if sys.platform == 'win32' else 'CONTROL-C'
        sys.stdout.write((
            "Django version {version_dj}, using settings '{settings}'\n"
            "pyftpdlib version {version_ftp}\n"
            "Quit the server with {quit_command}.\n").format(
            version_dj=get_version(),
            version_ftp=pyftpdlib.__ver__,
            settings=settings.SETTINGS_MODULE,
            quit_command=quit_command))
        server.serve_forever()
dataset/ETHPy150Open tokibito/django-ftpserver/src/django_ftpserver/management/commands/ftpserver.py/Command.handle