4π
β
Iβm pretty sure the issue is caused by the commas you have for the trailing fields, in python, this is indicating that youβre creating a tuple and it will treat the next line as a continuation of that tuple object, you need to remove them
class Testimonial(models.Model):
name = models.CharField(max_length=20, null=True),
quote = models.CharField(max_length=255, null=True),
test = models.CharField(max_length=20, null=True)
should be
class Testimonial(models.Model):
name = models.CharField(max_length=20, null=True)
quote = models.CharField(max_length=255, null=True)
test = models.CharField(max_length=20, null=True)
π€Sayse
0π
If you do not want to remove the βquoteβ β simply remove manually the operation of this migration.
operations = [
migrations.AddField(
model_name='testimonial',
name='test',
field=models.CharField(max_length=20, null=True),
),
]
And execute: python manage.py migrate app_name. Perhaps when you create a migration, you accidentally commented out this field.
- [Django]-Unable to create a custom admin template url, getting errors Template errors & creating custom admin site errors
- [Django]-Django admin, setting a non-editable date field on creation with the DateTime widget
- [Django]-How to solve UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Source:stackexchange.com