TypeError: argument of type ‘WindowsPath’ is not iterable
运行django项目是报错
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/e4ef87d03af110aa7c1f6b5cf4ab4053.png)
- 原因: django新版本在setting中数据库配置代码变动了
对比
旧版本2.0
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a84497af49acb6439d65337541ee7cb4.png)
新版本4.0
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/9961a700c9c0290e181ba81426dd6cab.png)
解决办法
import os
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}