K
K
KianGreenMoon2018-05-03 23:38:03
Django
KianGreenMoon, 2018-05-03 23:38:03

Why is Django asking me for a default date even if blank=True?

I command: makemigrations, and asks to enter the default setting. I ask myself: what for is she to you? I write blank = True. But history repeats itself. A little angry, I wrote: default = 'Error: the date is not found'. Makemigrations ate it, but migrate was offended and writes me that I entered the wrong date! Of course! I write blank=True again, but now makemigrations doesn't want to listen to me at all, and migrate is convinced that I'm still trying to silence the above line as a date. But I don’t understand what the hell I did x) Help someone with what you can, we ourselves are not local!

class Album(models.Model):
    name = models.CharField(max_length=35)
    date = models.DateTimeField()
   
    def __str__(self):
        return self.name

Yes, and it all started with the fact that I wanted to remove the create_date line with the auto_now_add=True argument, and create, respectively, date without this argument.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question