TypeError: argument of type ‘WindowsPath’ is not iterable
运行django项目是报错
- 原因: django新版本在setting中数据库配置代码变动了
对比
旧版本2.0
新版本4.0
解决办法
import os
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}