2
Going off the other comments and my own experience . . . when you get this error, go into your migrations folder and delete everything except the __init__.py
. You can even delete the __pycache__
folder. Then run makemigrations
and migrate
again. I think that should fix the problem.
0
This can also happen when making a CharField nullable if you do not specify max_length.
So the solution is to specify max_length in your model, then remove and remake the problematic migration..
This was described as a bug here.
- [Django]-Option does not take a value error
- [Django]-How do you avoid SQL Injection attacks in your Django Rest APIs if using native ORM?
- [Django]-Django URLResolver error
- [Django]-Create a custom html template using forms in Django
- [Django]-Django Model not automatically creating ID
0
This is old, but I will answer anyway.
The problem is that you made a "makemigrations" with a mistake in your model and that was catalogued, I will assume you corrected the mistake, that catalogue is not deleted, instead it was aggregated when you tried Migration.
What you need to do is delete everything in your migration folder except init, that should clear that up, if it doesn’t then you still have a mistake in your Model