AttributeError:“Meta”对象没有属性“app\u config”

2024-06-17 13:28:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试从git repo在本地计算机上运行一个已经存在的项目。尝试运行命令“python管理.pyrunserver“生成一个AttributeError。在

错误在第81行:

def check(self, app_configs):

    if app_configs is None:
        app_configs = apps.get_app_configs()
    app_configs = set(app_configs)  # Speed up lookups below

    errors = []
    modeladmins = (o for o in self._registry.values() if o.__class__ is not ModelAdmin)
    for modeladmin in modeladmins:
        if modeladmin.model._meta.app_config in app_configs: #ErrorHere
            errors.extend(modeladmin.check())
    return errors

命令提示符出错

^{pr2}$

Tags: 项目ingitselfappforifis