0

I'm using STATICFILES_STORAGE = 'offsite_storage.storages.CachedS3FilesStorage' to store all my static files on S3. On my localhost it's trying to load assets using staticfiles from my S3 location without the hashed name. But my STATICFILES_STORAGE provider (django-offsite-storage) only uploads the hashed name version to S3. I want to keep DEBUG=True on my local machine, but I want my S3 assets to load the hashed filename version.

Is there anyway to do this?

Chad
  • 1,708
  • 1
  • 25
  • 44

1 Answers1

1

You can use a workaround. Create a file called local_settings.py and set a different storage. After, in your settings import the module:

try:
    from local_settings import *
except ImportError:
    pass

Keep that file only in the local version of your site.

kamy22
  • 143
  • 5
  • You can find different solutions here [How to manage local vs production settings in Django](http://stackoverflow.com/a/1629770/974613) – kamy22 Aug 13 '15 at 18:27