expected string or buffer ,date_re.match(value) django error

前端 未结 2 1628
感动是毒
感动是毒 2020-12-20 17:38

I want to extent custom user model in django.I copy paste code from django official website. When i want to migrate it it throw error

TypeError: expected str         


        
相关标签:
2条回答
  • 2020-12-20 17:52

    Your problem is this line in your migration file:

    field=models.DateField(default=1),
    

    Change it to

    field=models.DateField(null=True),
    

    or

    field=models.CharField(max_length=20),
    
    0 讨论(0)
  • 2020-12-20 18:07

    yes, the semicolon at the back is removed in order to automatically modify the table in the database, like this line:

    signdate = models.DateField(verbose_name="Sign Date", blank=True, null=True)
    
    0 讨论(0)
提交回复
热议问题