본문 바로가기
○ WEB/21.02 CodeLion_Django Web

[에러 해결] Auto-created primary key used when not defiing a primary key type, by default 'django.db.models.AutoField'.

by 0ver-grow 2021. 4. 9.
반응형

에러명

Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.

해결방법

settings.py파일에 추가

DEFAULT_AUTO_FIELD='django.db.models.AutoField'

 

참고

 

Auto-create primary key used when not defining a primary key type warning in Django

I just updated my python from 3.9.1 to 3.9.4. When I tried to run the server. The console gave me a warning for this: WARNINGS: learning_logs.Entry: (models.W042) Auto-created primary key used when...

stackoverflow.com

 

반응형