Django manage.py collectstatic not uploading to go

2019-08-11 10:12发布

问题:

Experience level with issue

This is my first experience with deploying static files and using Django.


Issue

When I run python manage.py collectstatic

I will get the following result:

2 static files copied to '/home/ymorin007/workspace/sites/onbytes.com/onbytes-static', 151 unmodified, 4 post-processed.

But nothing is beeing push to my bucket in google cloud storage. I'm not getting any errors in the terminal. Anything I'm missing her?


My code

I'm using django-storages

This is the following definition in my setting.py:

STATIC_ROOT = '/home/ymorin007/workspace/sites/onbytes.com/static'
STATIC_URL = 'http://storage.googleapis.com/onbytes-static/'

LIBCLOUD_PROVIDERS = {
    'google': {
        'type': 'libcloud.storage.types.GOOGLE_STORAGE',
        'user': 'XXXXXX', 
        'key': 'XXXXX',
        'bucket': 'onbytes-static',
    },
}

DEFAULT_FILE_STORAGE = 'storages.backends.apache_libcloud.LibCloudStorage'
STATICFILES_STORAGE = 'storages.backends.apache_libcloud.LibCloudStorage'

my requirements.txt

...
boto==2.30.0
django-pipeline==1.3.25
django-storages==1.1.8

回答1:

Stupid mistake I had another definition in the setting.py linked to Pipeline

STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'