请帮助我从 python manage.py makemigrations 得到这个错误
“post”的迁移:post/migrations/0022_auto_20200929_1749.py - 从帖子中删除字段类别 - 从帖子中删除字段标记回溯(最近一次调用最后):文件“manage.py”,第 22 行,在 main() 文件“manage”中.py”,第18行,在主execute_from_command_line(sys.argv)文件“/usr/lib/python3.8/site-packages/django/core/management/ init .py”,第381行,在execute_from_command_line utility.execute( )文件“ /usr/lib/python3.8/site-packages/django/core/management/init.py”,第 375 行,在执行 self.fetch_command(subcommand).run_from_argv(self.argv) 文件“/usr/lib/python3.8/site-packages/django/core/management/base.py”,第 336 行,在run_from_argvconnections.close_all()文件“/usr/lib/python3.8/site-packages/django/db/utils.py”中,第224行,在close_allconnection.close()文件“/usr/lib/python3 .8/site-packages/django/db/backends/sqlite3/base.py”,第 248 行,如果不是 self.is_in_memory_db() 则关闭:文件“/usr/lib/python3.8/site-packages/django/ db/backends/sqlite3/base.py”,第 367 行,is_in_memory_db 中 return self.creation.is_in_memory_db(self.settings_dict['NAME']) 文件“/usr/lib/python3.8/site-packages/django/db /backends/sqlite3/creation.py”,第 12 行,在 is_in_memory_db 中返回 database_name == ':memory:' 或数据库名称中的 'mode=memory' 类型错误:'PosixPath' 类型的参数不是 iterabl
models.py 从 django.db 导入模型
> # Create your models here. from django.db import models from django.utils import timezone
>
>
> class Post(models.Model):
> author = models.ForeignKey('auth.User', on_delete=models.CASCADE ,null=True)
> title = models.CharField(max_length=200,null=True)
> description=models.TextField(default='a')
> text = models.TextField(null=True)
> Img = models.ImageField(upload_to='images/',null =True)
> UserImg= models.ImageField(upload_to='images/user/',null =True)
>
> created_date = models.DateTimeField(
> default=timezone.now)
> published_date = models.DateTimeField(
> blank=True, null=True)
烙印99
相关分类