Question

python manage.py collectstatic does not copy all my static files

I currently have DigitalOcean spaces setup & using it with django via ‘django-storages’.

Currently I am running into a problem where the collectstatic command will not collect all my static files.

settings.py - static files

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]

AWS_ACCESS_KEY_ID = 'my_access_key' 
AWS_SECRET_ACCESS_KEY = 'my_secret_key'

AWS_STORAGE_BUCKET_NAME = 'lrev'
AWS_S3_ENDPOINT_URL = 'https://fra1.digitaloceanspaces.com'
AWS_S3_OBJECT_PARAMETERS = {
    'CacheControl': 'max-age=86400',
}

STATICFILES_STORAGE = 'custom_storages.StaticStorage'
DEFAULT_FILE_STORAGE = 'custom_storages.MediaStorage'

# Use AWS_S3_ENDPOINT_URL here if you haven't enabled the CDN and got a custom domain. 
STATIC_URL = '{}/{}/'.format(AWS_S3_ENDPOINT_URL, 'static')
STATIC_ROOT = '/static/'

MEDIA_URL = '{}/{}/'.format(AWS_S3_ENDPOINT_URL, 'media')
MEDIA_ROOT = '/media/'

TEMP = "{}/{}".format(MEDIA_ROOT, 'temp')

My Static Files:

static
 - accounts
 - core
 - images
 - lrdc
 - terms
 - jquery.js

Digital Ocean Spaces:

static
 - images
 - images
 - admin
 - jquery.js

Any help will be greatly appreciated! Thank you :D


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer