2

So I made the following silly error in models.py:

caption_on = models.BooleanField(default='true')

which gave me the following error when i ran 'makemigrations' and 'migrate'

django.core.exceptions.ValidationError: ["'true' value must be either True or False."]

So I fixed my mistake by changing my models.py line to

caption_on = models.BooleanField(default=True)

but this gave me again the same django.core.exceptions.ValidationError. It's like my models.py doesn't get updated. Even when I delete the line in models.py the error appears.

Anyone any idea on how to fix this?

Jules
  • 25
  • 2
  • 4

1 Answers1

8

You can not run the migrations successfully?

  1. Go into the migrations folder in your app.

  2. Look for the migration file where you would like to go back to. (for example 0012_post_category.py)

  3. go in the terminal write: ./manage.py migrate yourAppName 0012 (this is just the example number) and hit enter

  4. if everything goes well. Delete the other migrations which came after this number in your migrations folder.

    Hope that helps.

Community
  • 1
  • 1
hansTheFranz
  • 2,511
  • 4
  • 19
  • 35