-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
数据库字段错误 #57
Comments
把user里面migrtations下面 文件中default=‘’,改成default=django.utils.timezone.now 然后在执行pyhton manage.py migrate就行了 |
users/models.py
from django.utils import timezone
start_time = models.DateTimeField(default=timezone.now, verbose_name='开始时间')
end_time = models.DateTimeField(default=timezone.now, verbose_name='结束时间')
add_time = models.DateTimeField(default=timezone.now, verbose_name="添加时间")
依然还是报这个错误
|
现在把user里面migrtations下面 文件中default=‘’,改成default=django.utils.timezone.now 能跑过 我在models.py文件里这么写 为啥不行呢 |
start_time = models.DateTimeField(default=auto_now_add=True, verbose_name='开始时间')试试看 |
start_time = models.DateTimeField(default=auto_now_add=True, verbose_name='开始时间') |
我直接改成了timezone.now 在虚拟机可以运行 但是我放在华为云上 |
有没有遇到这种报错?OperationFailure at /api/server_assets/ command insert requires authentication Request Method: POST Request URL: http://XXXXX:8000/api/server_assets/ |
我批量导入的时候遇到UnicodeDecodeError at /assets/import_assets/ 'utf-8' codec can't decode byte 0xd0 in position 162: invalid continuation byte Request Method 这个是导入文件的问题? |
没有遇到 |
@lculiuyanlong 在批量导入的时候你们有没有报错 |
django.core.exceptions.ValidationError: ["'' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]
The text was updated successfully, but these errors were encountered: