错误->>>预期的字符串或类似字节的对象
我知道这是怎么回事
models.py->>
publish_date = models.DateTimeField(auto_now =True, auto_now_add = False, null =True)
timestamp = models.DateTimeField( auto_now_add = True, )
updated = models.DateTimeField(auto_now =True)
答案 0 :(得分:0)
您不应同时使用auto_now
和auto_now_add
。
publish_date = models.DateTimeField(auto_now =True, null =True)
timestamp = models.DateTimeField(auto_now_add = True )
答案 1 :(得分:0)
您不能同时使用auto_now和auto_now_add,因为它们是互斥的。
publish_date = models.DateTimeField(auto_now =True, null =True)
timestamp = models.DateTimeField( auto_now = True, )
updated = models.DateTimeField(auto_now =True)