ValueError: Related model u'app.model' cannot be resolved

后端 未结 6 794
甜味超标
甜味超标 2020-12-29 02:06

I have two applications (ook and eek say) and I want to use a foreign key to a model in ook from a model in eek. Both are

6条回答
  •  失恋的感觉
    2020-12-29 02:16

    In my case, It was the cache and previous migrations that resulted in this error. I removed __pycache__ and migrations folder and then re-run the migrations command and it worked.

    Remember, when you'll do python manage.py makemigrations it won't see any new migrations and will console output no changes detected. You'll have to do python manage.py makemigrations your_app_name instead to make things work.

提交回复
热议问题