Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7885735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:08:49+00:00 2026-06-03T05:08:49+00:00

I’m receiving the following error when I run collectstatic: AttributeError: ‘cStringIO.StringO’ object has no

  • 0

I’m receiving the following error when I run collectstatic:

AttributeError: 'cStringIO.StringO' object has no attribute 'name'

Everything works fine until I try and gzip my files using storages “AWS_IS_GZIPPED” setting (see my settings.py below).

I am using django-storages which utilizes boto to send my static files up to S3 and django-compressor to compress them.

Here is a full traceback of my error:

Copying '/home/somewhere/current/something/shows/static/skin/jplayer.band.css'
Traceback (most recent call last):
  File "./manage.py", line 14, in <module>
    execute_manager(settings)
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/somewhere/env/lib/python2.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 89, in handle_noargs
    self.copy_file(path, prefixed_path, storage, **options)
  File "/home/somewhere/env/lib/python2.6/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 202, in copy_file
    self.storage.save(prefixed_path, source_file)
  File "/home/somewhere/current/something/storage.py", line 28, in save
    self.local_storage._save(filename, content)
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/files/storage.py", line 190, in _save
    for chunk in content.chunks():
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/files/base.py", line 65, in chunks
    counter = self.size
  File "/home/somewhere/env/lib/python2.6/site-packages/django/core/files/base.py", line 39, in _get_size
    elif os.path.exists(self.file.name):
AttributeError: 'cStringIO.StringO' object has no attribute 'name'

Here is my storage.py

class CachedS3BotoStorage(S3BotoStorage):
    def __init__(self, *args, **kwargs):
        super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
        self.local_storage = get_storage_class('compressor.storage.CompressorFileStorage')()

    def save(self, filename, content):
        filename = super(CachedS3BotoStorage, self).save(filename, content)
        self.local_storage._save(filename, content)
        return filename 

which comes straight from the django-compressor docs.

I also have the following in my settings.py

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = 'something' 
AWS_SECRET_ACCESS_KEY = 'something_else' 
AWS_STORAGE_BUCKET_NAME = 'something' 
AWS_S3_CUSTOM_DOMAIN = 'static.example.com' #without this compressor points to my s3 bucket, I serve from CloudFront
AWS_IS_GZIPPED = True #If this is false, everything works, but no gzipping!
AWS_S3_SECURE_URLS = False #turns off https for static files (necessary)

import datetime
future = datetime.datetime.now() #+ datetime.timedelta(days=364)
AWS_HEADERS = {
    'Expires': future.strftime('%a, %d %b %Y %H:%M:%S GMT'),
    'Cache-Control': 'max-age=60, public' #'max-age=31536000, public'
}

STATICFILES_STORAGE = 'something.storage.CachedS3BotoStorage' 

from S3 import CallingFormat
AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN

COMPRESS_ENABLED = True #can remove when ready for production
COMPRESS_OFFLINE = True 
COMPRESS_URL = 'http://static.example.com/'
COMPRESS_STORAGE = 'something.storage.GzipCompressorStorage'
COMPRESS_OUTPUT_DIR = 'compressed_static'
COMPRESS_ROOT = '/home/somewhere/static'

Any help would be much appreciated. A bit lost in the woods.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:08:50+00:00Added an answer on June 3, 2026 at 5:08 am

    https://github.com/jezdez/django_compressor/issues/100 has a proposed work around.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
In my XML file chapters tag has more chapter tag.i need to display chapters
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.