美文网首页
ImportError: cannot import name

ImportError: cannot import name

作者: 字节码 | 来源:发表于2017-12-19 00:40 被阅读461次

    django 1.10 错误:

    修改django.contrib.contenttype.apps.py 即可

    from .management import (
        inject_rename_contenttypes_operations,
        # update_contenttypes,
        create_contenttypes,
    )
    

    将 update_contenttypes 替换 create_contenttypes

    def ready(self):
        pre_migrate.connect(inject_rename_contenttypes_operations, sender=self)
        # post_migrate.connect(update_contenttypes)
        post_migrate.connect(create_contenttypes)
        checks.register(check_generic_foreign_keys, checks.Tags.models)
    

    将update_contenttypes 替换为 create_contenttypes

    参考资料

    相关文章

      网友评论

          本文标题:ImportError: cannot import name

          本文链接:https://www.haomeiwen.com/subject/rewvwxtx.html