django-pipeline不压缩 [英] django-pipeline not compressing

查看:120
本文介绍了django-pipeline不压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装django-pipeline到我的django应用程序,它似乎没有压缩我的javascript文件。它似乎正确安装,因为模板标签工作正常。我使用manage.py collectstatic为了压缩文件。这里是我当前的配置。我也设置了我的应用程序使用django-staticfiles每django管道文档,因为我使用Django 1.3。

I have just installed django-pipeline into my django application and it doesn't seem to be compressing my javascript files. It seems to be installed properly as the template tags are working correctly. I'm using manage.py collectstatic in order to compress the files. Here is my current configuration. I have also set up my app to use django-staticfiles per the django-pipeline docs as I'm using Django 1.3.

 STATIC_ROOT = os.path.join(PROJECT_ROOT, 'site_media', 'static')
 STATIC_URL = '/site_media/static/'
 ADMIN_MEDIA_PREFIX = '/site_media/static/admin/'

 STATICFILES_DIRS = (
    os.path.join(PROJECT_ROOT, "media"),
 )

 STATICFILES_FINDERS = (
    ##Turn these on if using django.contrib.staticfiles
    ##'django.contrib.staticfiles.finders.FileSystemFinder',
    ##'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    ##'django.contrib.staticfiles.finders.DefaultStorageFinder',

    ##Turn these on if using django.contrib.staticfiles
    'staticfiles.finders.FileSystemFinder',
    'staticfiles.finders.AppDirectoriesFinder',
    'staticfiles.finders.DefaultStorageFinder'
 )

 PREREQ_APPS = [
    # Django
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',

    #External
    'south',
    'staticfiles',
    'pipeline',    
 ]


 PIPELINE_YUI_BINARY='/Applications/yuicompressor-2.4.7/build/yuicompress'

 PIPELINE_JS = {
    'site': {
        'source_filenames': (
            'js/libs/ddsmoothmenu.js',
            'js/script.js',
        ),
        'output_filename': 'js/script.min.js',
    }
 }

我不知道我在这里缺少什么,是什么。

I'm not sure what I'm missing here, but I'm sure it is something. I am not getting any error messages or anything, it just isn't compressing.

感谢您的帮助!

推荐答案

您是否使用以下方法设置了静态文件:

Did you setup staticfiles with :

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'

如果是:

    $ b

'/ Applications / yuicompressor-2.4.7 / build / yuicompress'一个可执行脚本?

这篇关于django-pipeline不压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆