Django pipeline generates empty files

ε祈祈猫儿з 提交于 2019-12-12 12:28:16

问题


I've got several apps in my django project and I'm using pipeline to compress files and all works fine, but I have an app called "mypage" for which every file generated after calling collectstatic is empty! (if I copy a file from mypage/static into another app static folder it's properly generated!) I'm going crazy! How can I debug this behavior? (no error or warning is displayed in the console and the pipeline configuration is properly defined because other static files are properly generated) Is perhaps "mypage" a somehow reserved word? 0_o

this is my configuration:

STATIC_URL = '/static/'
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
    'pipeline.finders.CachedFileFinder',
)
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
PIPELINE_DISABLE_WRAPPER = True
PIPELINE_ENABLED = True
PIPELINE_JS = {
    'foo': {
        'source_filenames': (
            'mypage/js/controllers/MyController.js',
        ),
        'output_filename': 'mypage/js/foo.js'
    },
}

...the generated "foo.js" is an empty file, if I move "MyController.js" to another app, let's say "fooapp", then fooapp/js/foo.js will contains the expected JavaScript :(


回答1:


Check for the file path to be mypage/static/mypage/js/controllers/MyController.js.



来源:https://stackoverflow.com/questions/19369965/django-pipeline-generates-empty-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!