You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from django.core.files.storage import default_storage
modified_time = default_storage.get_modified_time(file_path)
报错信息:
modified_time = default_storage.get_modified_time(file_path)\n File "/app/.heroku/python/lib/python3.6/site-packages/bkstorages/backends/bkrepo.py", line 412, in get_modified_time\n return localtime(dt)\n File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/timezone.py", line 207, in localtime\n raise ValueError("localtime() cannot be applied to a naive datetime")\nValueError: localtime() cannot be applied to a naive datetime\n"
The text was updated successfully, but these errors were encountered:
环境版本:
python3.6
Django==2.2.6
bkstorages==1.0.6
default.py设置:
USE_TZ = True
TIME_ZONE = 'Asia/Shanghai'
LANGUAGE_CODE = 'zh-hans'
问题代码:
from django.core.files.storage import default_storage
modified_time = default_storage.get_modified_time(file_path)
报错信息:
modified_time = default_storage.get_modified_time(file_path)\n File "/app/.heroku/python/lib/python3.6/site-packages/bkstorages/backends/bkrepo.py", line 412, in get_modified_time\n return localtime(dt)\n File "/app/.heroku/python/lib/python3.6/site-packages/django/utils/timezone.py", line 207, in localtime\n raise ValueError("localtime() cannot be applied to a naive datetime")\nValueError: localtime() cannot be applied to a naive datetime\n"
The text was updated successfully, but these errors were encountered: