Home>


When I move to the url and move to my product as shown in the image above, I get an error.

from django.db import models
#Create your models here.
class Product (models.Model):
    title = models.CharField (max_length = 120)
    description = models.TextField (null = True)
    price = models.DecimalField (decimal_places = 2, max_digits = 10000) #This is the cause of the error
    summary = models.TextField (null = True)

I know where the error is, but I don't know why.
What should I do?

In the terminal, type python manage.py makemigraitions

You are trying to change the nullable field'title' on product to non-nullable without a default;we can't do that
(the database needs something to populate existing rows).
Please select a fix:
 1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
 2) Ignore for now, and let me handle existing rows with NULL myself (e.g. because you added a RunPython or RunSQL
operation to handle NULL values ​​in a previous data migration)
 3) Quit, and let me add a default in models.py
Select an option: Select an option:


It will become.
What's wrong?