I'm currently working on a mezzanine cartridge site and I'm trying to use 
Amazon S3 to serve large (200Mb+) digital download files. 

Has anyone had success with using Amazon S3 with Mezzanine/Django 
Filebrowser? I've been looking around all morning for some help and I can't 
seem to get filebrowser to upload files correctly to my S3 bucket. I 
continue to get an http error while trying to post uploads and I can't 
figure out what I'm missing.


A few things:

   - I can browse the files and select ones that I've manually uploaded to 
   S3 and they work fine.
   - I can upload files from non Mezzanine File Fields (IE: Product 
   Images), but I cannot get anything that uses 
   mezzanine.core.fields.Filefield to upload through Django-Filebrowser
   - I've tried django-storages default and s3boto backends as my 
   DEFAULT_FILE_STORAGE
   - I've tried a custom file storage backend that I found at the bottom of 
This 
   Post <https://github.com/sehmaschine/django-filebrowser/issues/40>
   - I do not want to serve my static files from Amazon S3, only media 
   uploads for my products such as images and downloadable files.
   
Has anyone had success getting filebrowser to correctly work with mezzanine 
and also host thumbnails?

Current settings.py:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_S3_SECURE_URLS = True     # use http instead of https
AWS_QUERYSTRING_AUTH = False     # don't add complex authentication-related 
query parameters for requests
AWS_S3_ACCESS_KEY_ID = 'my_key'     # enter your access key id
AWS_S3_SECRET_ACCESS_KEY = 'my_secret_key' # enter your secret access key
AWS_STORAGE_BUCKET_NAME = 'dev'
AWS_S3_CUSTOM_DOMAIN = 's3.amazonaws.com/%s' % AWS_STORAGE_BUCKET_NAME
S3_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME
MEDIA_URL = S3_URL

# MEDIA_ROOT = 'media/uploads'
FILEBROWSER_DIRECTORY = 'media/uploads'



S3 Privacy Settings (I have not created a user and group, I was just trying 
to get it working first):

{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::luab/*"
        }
    ]
}

Amazon S3 CORS Policy:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/";>
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>DELETE</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to