簡體   English   中英

Django的collectstatic錯誤

[英]Django collectstatic error

錯誤:

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\management\__init__.py", line 459, in execute_manager
utility.execute()
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\management\__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\management\base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\management\base.py", line 232, in execute
output = self.handle(*args, **options)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\management\base.py", line 371, in handle
return self.handle_noargs(**options)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 163, in handle_noargs
collected = self.collect()
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 113, in collect
handler(path, prefixed_path, storage)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 287, in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 219, in delete_file
self.storage.modified_time(prefixed_path)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\files\storage.py", line 264, in modified_time
return datetime.fromtimestamp(os.path.getmtime(self.path(name)))
ValueError: timestamp out of range for platform localtime()/gmtime() function

(env) D:\CODE\wamp\www\lezcheung\lezcms>

有人知道幫我嗎?

看來這是由於collectstatic的文件的上次修改時間戳非常不准確(例如1970年前)造成的。 嘗試在Google上搜索一些工具,這些工具可讓您修改文件的最后修改日期並將其更改為合理的值。

我感到失望。

這只是因為我在/ static / fonts /中放了一些字體,而django不接受Static Folder上的字體。 因此,我將此文件更改為/ media / fonts /。

工作了! :D

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM