def handle(self, dash_name=None, **options):
        if dash_name is None:
            raise CommandError("You must provide a dashboard name.")

        # Use our default template if one isn't specified.
        if not options.get("template", None):
            options["template"] = self.template

        # We have html templates as well, so make sure those are included.
        options["extensions"].extend(["tmpl", "html", "js", "css"])

        # Check that the app_name cannot be imported.
        try:
            import_module(dash_name)
        except __HOLE__:
            pass
        else:
            raise CommandError("%r conflicts with the name of an existing "
                               "Python module and cannot be used as an app "
                               "name. Please try another name." % dash_name)

        super(Command, self).handle('dash', dash_name, **options)

        target = options.pop("target", None)
        if not target:
            target = os.path.join(os.curdir, dash_name)

        # Rename our python template files.
        file_names = glob.glob(os.path.join(target, "*.py.tmpl"))
        for filename in file_names:
            os.rename(filename, filename[:-5])
dataset/ETHPy150Open CiscoSystems/avos/horizon/management/commands/startdash.py/Command.handle