Hi, 

Many thanks for taking the time to write such a detailed reply.

By thumbnails do you mean the featured images for the blog? If so
yes I was planning on storing that, plus other user uploaded media, and 
static files on s3.

So using the bugfix you pointed me to I created the file
mystorages.py <http://paste.ubuntu.com/7496615/> (see link) in my project 
defining the subclass 

PublicS3BotoStorage (where are you using this in your settings.py?)

Some questions:

1) Why do you define
    AWS_SECRET_KEY = os.environ['AWS_SECRET_KEY']
    AWS_SECRET_ACCESS_KEY = AWS_SECRET_KEY
and not just 
    AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_KEY']

2) What is the difference between 
AWS_BUCKET_NAME and AWS_STORAGE_BUCKET_NAME here? and why
do define 'AWS_STORAGE_BUCKET_NAME' twice? (just a typo?)

3) You define DEFAULT_FILE_STORAGE = 's3_folder_storage.s3.DefaultStorage'
and STATICFILES_STORAGE = 's3_folder_storage.s3.StaticStorage'. Are these the 
locations
of your custom storage classes DefaultStorage and StaticStorage? How are they 
related to
to the PublicS3BotoStorage class from the bug fix? (assuming they are)

4) Why are MEDIA_ROOT and MEDIA_URL empty?

These considerations lead me to try and mimic your settings with

########################################
# Attempt fix from mezzanine users group
########################################
#
# AMAZON - AWS
# S3 config
AWS_ACCESS_KEY_ID="myid"
AWS_SECRET_ACCESS_KEY="myaccesskey"

AWS_STORAGE_BUCKET_NAME = 'my_bucket'
AWS_BUCKET_NAME = 'my_bucket'

AWS_QUERYSTRING_AUTH = False
AWS_S3_SECURE_URLS = False
AWS_S3_ENCRYPTION =  False
from boto.s3.connection import ProtocolIndependentOrdinaryCallingFormat
AWS_S3_CALLING_FORMAT = ProtocolIndependentOrdinaryCallingFormat()

DEFAULT_FILE_STORAGE = 'mystorages.PublicS3BotoStorage'
DEFAULT_S3_PATH = "media"
MEDIA_ROOT = ''
MEDIA_URL = ''

STATICFILES_STORAGE = 'mystorages.PublicS3BotoStorage'
STATIC_S3_PATH = "static"
STATIC_ROOT = "/%s/" % STATIC_S3_PATH
STATIC_URL = '//s3.amazonaws.com/%s/static/' % AWS_STORAGE_BUCKET_NAME
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'

Notice in particular I use STATICFILES_STORAGE = 
'mystorages.PublicS3BotoStorage'

where mystorages.py is defined as in my link above (i.e. the bug fix 
subclass defined in there).

The site loads and css/js/img are served from s3, but now when I try to add 
a blog post in the admin
I get the error

 "PublicS3BotoStorage' object has no attribute 'isdir'"

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to