简体   繁体   English

Django的collectstatic错误

[英]Django collectstatic error

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>

Anyone know help me? 有人知道帮我吗?

This looks like it's caused by files being collected by collectstatic having outrageously inaccurate last modified timestamps (like before 1970). 看来这是由于collectstatic的文件的上次修改时间戳非常不准确(例如1970年前)造成的。 Try searching google for tools that allow you to modify your files' last modified dates and change them to something reasonable. 尝试在Google上搜索一些工具,这些工具可让您修改文件的最后修改日期并将其更改为合理的值。

I discoreved. 我感到失望。

This is just cause I put some fonts in /static/fonts/ and the django don't accept fonts on Static Folder. 这只是因为我在/ static / fonts /中放了一些字体,而django不接受Static Folder上的字体。 So, i changed this files to /media/fonts/. 因此,我将此文件更改为/ media / fonts /。

Worked! 工作了! :D :D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM