现在,运行时python manage.py collectstatic
会生成一个缩小的文件,但它是完全空的。
这是我的settings.py(我在windows环境中):
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
PIPELINE_ENABLED = True
PIPELINE_DISABLE_WRAPPER = True
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.yui.YUICompressor'
PIPELINE_YUI_BINARY = "C:\\path\\to\\the\\yuicompressor.jar"
PIPELINE_JS = {
'chat': {
'source_filenames': (
'js/apps/chat/controllers/chatcontrollers.js',
),
'output_filename': 'js/test.min.js',
}
}
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static/")
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(
BASE_DIR,
'media_src',
),
)
我看到了这个回复:Django 管道已经生成空文件,但我的文件位于
myapp/media_src/js/apps/chat/controllers/