InvalidBasesError: Cannot resolve bases for []

后端 未结 14 955
遥遥无期
遥遥无期 2021-02-03 23:03

When I run tests I get this error during database initialization:

django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [

        
14条回答
  •  不知归路
    2021-02-03 23:43

    Having spent the majority of this afternoon trying to solve this error myself, going through every conceivable mixture of 'commenting out apps', 'dropping tables' and dropping entire databases I found that my issue was caused by a simple lack of a 'migrations' folder and an __ init__.py file inside of said folder.

    One of the older answers which was correct is now no longer correct as they have fixed the issue mentioned here.

    Check every directory that contains the model mentioned in 'init.py' and it should go away.

    Probably won't solve everyone's case but it helped mine.

提交回复
热议问题