Django自定义状态码

class BaseResponse:
    def __init__(self):
        self.code = 1000
        self.data = None
        self.error = None

    @property
    def dict(self):
        return self.__dict__
原文地址:https://www.cnblogs.com/wt7018/p/11650390.html