开发者

Am I reading this documentation wrong for this Django app?

开发者 https://www.devze.com 2023-02-07 02:41 出处:网络
MEDIASYNC = {\'AWS_KEY\': AWS_ACCESSKEY, \'AWS_SECRET\': AWS_SECRETKEY, \'AWS_BUCKET\': \"abc_media\", \'BACKEND\': \'mediasync.backends.s3\',
MEDIASYNC = {    'AWS_KEY': AWS_ACCESSKEY,
    'AWS_SECRET': AWS_SECRETKEY,
    'AWS_BUCKET': "abc_media",
    'BACKEND': 'mediasync.backends.s3',
    'SERVE_REMOTE': True,    'AWS_BUCKET_CNAME': True,
    'DOCTYPE': 'html4',    
    'USE_SSL': False,
    'PROCESSORS': (
        'mediasync.processors.slim.js_minifier',
        ),
    'JOINED': {
        'js/joined.js': [
                        'js/plugins/jquery-msdropdown/js/jquery.dd.js',
                        'js/plugins/jquery.scrollTo-1.4.2/jquery.scrollTo-min.js',
                        'js/plugins/jquery-ui-1.8.7.custom/js/jquery-ui-1.8.7.custom.min.js',
                        'js/plugins/jquery.masonry.min.js',
                        'js/plugins/jquery.jeditable.mini.js',
                        'js/plugins/jquery.growfield2.js',
                        'js/plugins/jquery.placeholder.js',
                        'js/plugins/jquery.color.js',
                        'js/plugins/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pa开发者_Python百科ck.js',
                        'js/plugins/tipsy/src/javascripts/jquery.tipsy.js',
                        'js/template/alertbar.js',
                        'js/fileuploader.js',
                        ],
        },
}

If I have this here and run python manage.py syncmedia:

  1. It minifies the js scripts and uploads them to S3
  2. It joins the js scripts, uploads a non-minified version to S3.

How do I minify this joined file, I want it minified too.

The doc is here:https://github.com/sunlightlabs/django-mediasync

Am I doing something wrong?


I'm the maintain of django-mediasync. What you are doing SHOULD work. It's working in many of the sites that we've deployed. What version of mediasync are you using? A checkout of master from Github or the released 2.0 version?

If you are still having problems with this, please fill out a bug report on the Github issues page. Thanks!

https://github.com/sunlightlabs/django-mediasync/issues


I suspect that the minification takes time, longer than the time it takes to upload the file on the server. Maybe it is better to use

def proc(filedata, content_type, remote_path, is_active):

and check if it is active. or if you can delay the upload.

0

精彩评论

暂无评论...
验证码 换一张
取 消