def handle(self, command, args): path = self.find_manage_py() if path: os.chdir(path) cmd = self.build_cmd(command, args) system(*cmd)
def start(self, options, args): if "--noinsecure" in args: args.remove("--noinsecure") else: args.append("--insecure") path = self.path while path != '/': manage = os.path.join(path, 'manage.py') if os.path.exists(manage): os.chdir(path) cmd = [] try: cmd.append({"rs2": "python2", "rs3": "python3"}[self.command]) except: pass cmd.extend([manage, 'runserver', "{}:{}".format(self.addr, self.port)]) cmd.extend(args) system(*cmd) path = dirname(path)