Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django南部ImageField_Django_Django South - Fatal编程技术网

Django南部ImageField

Django南部ImageField,django,django-south,Django,Django South,对于管理数据库字段来说,South是一件很棒的事情,但我不明白——到底为什么它不适用于ImageFields 以下是我的情况-我通过了官方的南方教程,就像这样-我的模型: from django.db import models class Knight(models.Model): name = models.CharField(max_length=100) of_the_round_table = models.BooleanField() dances_whe

对于管理数据库字段来说,South是一件很棒的事情,但我不明白——到底为什么它不适用于ImageFields

以下是我的情况-我通过了官方的南方教程,就像这样-我的模型:

from django.db import models


class Knight(models.Model):
    name = models.CharField(max_length=100)
    of_the_round_table = models.BooleanField()
    dances_whenever_able = models.BooleanField()
模式迁移骑士——自动迁移骑士表现不错。但我要添加一个字段:

photo_of_a_knight = models.ImageField(upload_to='/photos/')
schemamigration--auto迁移骑士导致以下错误:

table "_south_new_Knights_knight" already exists

我在这里看到了一些变通方法,但它们对我没有用处。最后,我需要删除所有与South相关的表,我的应用程序和迁移将很好地完成。如何克服这个问题?

我想您忘记了伪造初始迁移0001了<代码>迁移骑士0001--伪造,然后执行正常迁移。请列出生成的迁移文件。看起来您可能已经生成了两次迁移。2 Aamir Adnan-fake migration nothing收到了相同的错误。2 Kevin Stone-迁移文件夹中有3个文件:0001_initial.py、0002_auto_添加_field_knight_photo.py和init.py。
0002_auto_添加_field_knight_photo.py的内容是什么?包含knight表的数据库结构是否包括所有列?