Problems Moving my mezzanine site to AWS EC2 + S3

40 views
Skip to first unread message

Salar Rahmanian

unread,
Jan 26, 2016, 7:27:29 AM1/26/16
to Mezzanine Users
Hi I am trying to move my Mezzanine site to be hosted on Amazon AWS EC2 with the static and media files on S3

My settings.py:

# Amazon
AWS_HEADERS = {
        'Expires': 'Thu, 31 Dec 2099 20:00:00 GMT',
        'Cache-Control': 'max-age=94608000',
    }

AWS_STORAGE_BUCKET_NAME = 'xxxxxx'
AWS_QUERYSTRING_AUTH = False
AWS_S3_SECURE_URLS = False

AWS_ACCESS_KEY_ID = env('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = env('AWS_SECRET_ACCESS_KEY')
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
STATICFILES_LOCATION = 'static'
MEDIAFILES_LOCATION = 'media'
STATICFILES_STORAGE = 'custom_storage.StaticStorage'
DEFAULT_FILE_STORAGE = 'custom_storage.MediaStorage'
STATIC_URL = "http://%s/%s/" % (AWS_S3_CUSTOM_DOMAIN,
                                STATICFILES_LOCATION)
MEDIA_URL = "http://%s/%s/" % (AWS_S3_CUSTOM_DOMAIN, MEDIAFILES_LOCATION)
MEDIA_ROOT = ''

custom_storage.py is: 

from mezzanine.conf import settings
from storages.backends.s3boto import S3BotoStorage


class StaticStorage(S3BotoStorage):
    location = settings.STATICFILES_LOCATION


class MediaStorage(S3BotoStorage):
        location = settings.MEDIAFILES_LOCATION


Collect static is working fine. 

Here are the issues I am having: 

- When I go to admin panel and want to add a page or a blog the tinyMCE dialog is missing 
- When I click Media Library I get error: 500 error
- When looking at existing content in Admin no content shown, but content appears on site


Any ideas what could be wrong? 

Thanks.

Paul Tremblay

unread,
Apr 14, 2018, 4:31:12 PM4/14/18
to Mezzanine Users
Did you ever get this fixed? We deploy Django at work using EC2 + S3.

Salar Rahmanian

unread,
Apr 14, 2018, 5:51:06 PM4/14/18
to mezzani...@googlegroups.com
I got it to work but the uploading pictures using mezzanine admin dash is super slow and I never found a fix for it to see why.


Regards,
Salar Rahmanian
--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/gELFQLtqkLo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Tremblay

unread,
Apr 16, 2018, 11:54:41 AM4/16/18
to mezzani...@googlegroups.com
Interesting. I have a similar problem at work with /media. Everything works in my local environment, but I will see what happens when I deploy to production, which uses S3.

To unsubscribe from this group and all its topics, send an email to mezzanine-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Henry Tremblay
Senior Software Developer Physcians Insurance
Reply all
Reply to author
Forward
0 new messages