Problem in “Setting Up Your Model” section of the book.
When I ran the makemigration command on the Thing data model, I got the following error related to the SlugField definition (slug = models.SlugField( unique = True))
You are trying to add a non-nullable field ‘book_slug’ to addressbook without a
default;
we can’t do that (the database needs something to populate existing rows).
Please select a fix:
- Provide a one-off default now (will be set on all existing rows)
- Quit, and let me add a default in models.py
Select an option: 2
Django wants the model to specify a default value. But a default value is not unique! How do I get around this error? I’m running Django 1.7.