1
1

More than 3 years have passed since last update.

ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.user', but app 'accounts' isn't installed.

Posted at

makemigarionsしようとしたらなんかエラー出た

ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.user', but app 'accounts' isn't installed.

なんじゃこれ?
そもそもaccountsというアプリは作っていないし、AUTH_USER_MODELにもそんな表記はしていない。
settings.pyを見てうんうん悩みましたが、結果分からなかったのでググりました。

ググった結果

まずヒットしたのはStackOverFlow。

ValueError: The field admin.LogEntry.user was declared with a lazy reference

回答に選ばれていたのは全部のmigrationsファイル消してもう一回やったら上手くいくよ!

最初のmakemigrationsでつまずいているのでこれは違う。

次のは一旦AUTH_USER_MODELを消して新しいテーブル作って、それでまたAUTH_USER_TABLE追加してください,
とのこと。

そもそもAUTH_USER_TABLEを表記していないのでこれも違う。

それぞれ色々試した結果、Redditに気になる回答が

Getting Errors When Running "Makemigrations"

私はvirtualenv作り直したら上手くいったよ

なるほど。ということで試したら見事に上手くいきました。

困っている方がいたら是非試してみてください!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1