参数格式
settings中设置request,参数转换方法的py文件地址路径
加载路径获取名称和方法名
def load_request_encoder(): checkers=[] for checker in settings.REQUEST_DATA_ENCODERS: if not checker.startswith('utils.RequestDataFactory') : continue check_module = None try: check_module = importlib.import_module(checker) except ModuleNotFoundError as e: module_name,class_name=checker.rsplit('.') check_module=getattr(importlib.import_module(module_name),class_name) all_methods=inspect.getmembers(check_module,inspect.isroutine) print(checker) #utils.RequestDataFactory for key,value in all_methods: checkers.append((checker,key)) print(checkers) #[('utils.RequestDataFactory', 'Default_Json2Form'), ('utils.RequestDataFactory', 'Default_Json2Json')] return checkers