我跟踪了django管道文档,在收集static时遇到了一个问题,控制台显示找不到指定的文件。在
没有djanog管道的收集工作。我还试图添加相同级别的静态文件,因为manage.py
没有任何区别。。。
以下是如何配置我的应用程序树:
Globalapp : (root folder)
- src (the base that contains all my django files)
-- staticfiles (folder here after collectstatic)
-- manage.py (file)
-- app (folder, where settings.py is)
...
-- pages (folder, where static files are)
--- static
- css
-- main.css
...
下面是我如何配置我的设置.py:
^{pr2}$我现在在本地主机上工作,运行python manage.py collectstatic
时出错,我做错什么了吗?在
回溯如下:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python34\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python34\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\Python34\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 199, in handle
collected = self.collect()
File "C:\Python34\lib\site-packages\django\contrib\staticfiles\management\commands\collectstatic.py", line 139, in collect
for original_path, processed_path, processed in processor:
File "C:\Python34\lib\site-packages\pipeline\storage.py", line 26, in post_process
packager.pack_stylesheets(package)
File "C:\Python34\lib\site-packages\pipeline\packager.py", line 100, in pack_stylesheets
variant=package.variant, **kwargs)
File "C:\Python34\lib\site-packages\pipeline\packager.py", line 118, in pack
content = compress(paths, **kwargs)
File "C:\Python34\lib\site-packages\pipeline\compressors\__init__.py", line 78, in compress_css
css = getattr(compressor(verbose=self.verbose), 'compress_css')(css)
File "C:\Python34\lib\site-packages\pipeline\compressors\yuglify.py", line 20, in compress_css
return self.compress_common(css, 'css', settings.YUGLIFY_CSS_ARGUMENTS)
File "C:\Python34\lib\site-packages\pipeline\compressors\yuglify.py", line 14, in compress_common
return self.execute_command(command, content)
File "C:\Python34\lib\site-packages\pipeline\compressors\__init__.py", line 247, in execute_command
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
File "C:\Python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1114, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The specified path to the file was not found.
最后我使用了django-compressor和{a2}。它的工作原理类似于django pipeline,我找不到这个特定问题的原因,但是所有这些包都在其他包中运行,这些包在组合时与pipeline几乎相同。在
如果在安装django compressor wiith pip时遇到问题,请尝试使用以下命令:
相关问题 更多 >
编程相关推荐