Skip to content
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

Open
wtchhb opened this issue Dec 25, 2019 · 10 comments
Open

数据库字段错误 #57

wtchhb opened this issue Dec 25, 2019 · 10 comments

Comments

@wtchhb
Copy link

wtchhb commented Dec 25, 2019

django.core.exceptions.ValidationError: ["'' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]

@lculiuyanlong
Copy link

把user里面migrtations下面 文件中default=‘’,改成default=django.utils.timezone.now 然后在执行pyhton manage.py migrate就行了

@wtchhb
Copy link
Author

wtchhb commented Dec 26, 2019 via email

@wtchhb
Copy link
Author

wtchhb commented Dec 26, 2019

现在把user里面migrtations下面 文件中default=‘’,改成default=django.utils.timezone.now 能跑过 我在models.py文件里这么写 为啥不行呢

@lculiuyanlong
Copy link

start_time = models.DateTimeField(default=auto_now_add=True, verbose_name='开始时间')试试看

@wtchhb
Copy link
Author

wtchhb commented Dec 26, 2019

start_time = models.DateTimeField(default=auto_now_add=True, verbose_name='开始时间')

@wtchhb
Copy link
Author

wtchhb commented Dec 26, 2019

我直接改成了timezone.now 在虚拟机可以运行 但是我放在华为云上
/mnt/Ops/utils/crypt_pwd.py
'str' object has no attribute 'decode'

@lculiuyanlong
Copy link

有没有遇到这种报错?OperationFailure at /api/server_assets/ command insert requires authentication Request Method: POST Request URL: http://XXXXX:8000/api/server_assets/

@wtchhb
Copy link
Author

wtchhb commented Dec 27, 2019

我批量导入的时候遇到UnicodeDecodeError at /assets/import_assets/ 'utf-8' codec can't decode byte 0xd0 in position 162: invalid continuation byte Request Method 这个是导入文件的问题?

@wtchhb
Copy link
Author

wtchhb commented Dec 27, 2019

有没有遇到这种报错?OperationFailure at /api/server_assets/ command insert requires authentication Request Method: POST Request URL: http://XXXXX:8000/api/server_assets/

没有遇到

@wtchhb
Copy link
Author

wtchhb commented Dec 30, 2019

@lculiuyanlong 在批量导入的时候你们有没有报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants