title: Django compressor is not working on hosted static files on amazon s3
body: <p><strong>Error:</strong> '<a href="https://socialboard-in.s3.amazonaws.com/static/notices/index1.css" rel="nofollow">https://socialboard-in.s3.amazonaws.com/static/notices/index1.css</a>' isn't accessible via COMPRESS_URL ('<a href="http://socialboard-in.s3.amazonaws.com/" rel="nofollow">http://socialboard-in.s3.amazonaws.com/</a>') and can't be compressed</p>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>INSTALLED_APPS = (
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'notices',
      'colleges',
      'accounts',
      'follows',
      'pagination',
      'topic',
      'wysihtml5',
      'crispy_forms',
      'ratelimit',
      'compressor',
      'storages',
  )
  STATIC_PATH = os.path.join(PROJECT_PATH,'static')
  STATIC_ROOT = 'staticfiles'
  STATIC_URL = '/static/'
  STATICFILES_DIRS = (
      STATIC_PATH,
  )
  
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
      # other finders..
      'compressor.finders.CompressorFinder',
  )
  
  
  TEMPLATE_DIRS = (
      # Put strings here, like "home/html/django_templates" Or "C:/www/django/templates".
      # Always use forward slashes, even on windows.
      # Don't forget to use absolute paths, not relative paths.
      TEMPLATE_PATH,
      os.path.join(BASE_DIR,'templates'),
  )
  
  AWS_ACCESS_KEY_ID =  os.environ["AWS_ACCESS_KEY_ID"]
  AWS_SECRET_ACCESS_KEY =  os.environ["AWS_SECRET_ACCESS_KEY"]
  AWS_STORAGE_BUCKET_NAME = os.environ['AWS_STORAGE_BUCKET_NAME']
  
  
  # All files uploaded to AWS S3 will have very long cache headers
  # automatically.
  
  AWS_HEADERS = {
   'Expires': 'Thu, 31 Dec 2099 20:00:00 GMT',
   'Cache-Control': 'max-age=94608000',
  }
  
  STATICFILES_STORAGE = 'custom_storages.CachedS3BotoStorage'
  
  COMPRESS_ENABLED = True
  
  COMPRESS_URL = "http://socialboard-in.s3.amazonaws.com/"
  
  STATIC_URL = "http://socialboard-in.s3.amazonaws.com/"
  
  
  COMPRESS_STORAGE = 'custom_storages.CachedS3BotoStorage'
  AWS_S3_CUSTOM_DOMAIN = 'socialboard-in.amazonaws.com/'
  </code></pre>
  
  <p><strong>custom_storages.py</strong></p>
  
  <pre><code>from django.core.files.storage import get_storage_class
  from storages.backends.s3boto import S3BotoStorage
  
  class CachedS3BotoStorage(S3BotoStorage):
      """
      S3 storage backend that saves the files locally, too.
      """
      def __init__(self, *args, **kwargs):
          super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
          self.local_storage = get_storage_class(
              "compressor.storage.CompressorFileStorage")()
  
      def save(self, name, content):
          name = super(CachedS3BotoStorage, self).save(name, content)
          self.local_storage._save(name, content)
          return name
  </code></pre>
  
  <p><strong>base.html</strong></p>
  
  <pre><code>{% compress css %} 
  &lt;link rel="stylesheet" type="text/css" href="{% static 'notices/index1.css' %}" /&gt;
  &lt;link href="{% static 'bootstrap-3.2.0-dist/css/bootstrap.min.css' %}" rel="stylesheet"&gt;
  &lt;!--&lt;link href="{% static 'bootstrap3-wysihtml5.min.css' %}" rel="stylesheet"&gt;  --&gt;
  {% block css %}{% endblock %} 
    {% endcompress %}
  </code></pre>
  
  <p>Everything is working perfectly without {% compress %} tag.</p>