Actually the site is not working with my S3 settings, so I'll think I'll
just move along until this pathway becomes more clear.
On Friday, 14 March 2014 15:51:15 UTC-7, Ross Laird wrote:
Well, my site is working now, with the S3 settings and with compression
on, but I'm not sure it's actually loading the files from S3. (The
Transfers list on S3 is empty.)
I'm not sure where to take this next, but for now I'm just going to leave
things alone. The site is working, at least.
On Friday, 14 March 2014 14:44:58 UTC-7, Ross Laird wrote:
Thanks for the tip. I have also seen the incompressible error due to
offsite files, but in my current situation I have not changed any templates
and the compression works without errors if I deactivate S3.
On Friday, 14 March 2014 14:38:57 UTC-7, Josh Cartmell wrote:
Hey Ross, I don't have experience with S3, so I don't know if this
applies, but in the past I have seen the incompressible file error if I
accidentally include something within the compress templatetags that isn't
on the same local filesystem as the site. Someone with more experience may
know how to get it working.
On Fri, Mar 14, 2014 at 2:24 PM, Ross Laird ro...@rosslaird.com wrote:
Without really knowing exactly how it happened, I got S3 file storage
working. I turned compression off, for now, and will try to debug that
next. As for the basic S3 setup, here are some of the things I did, in
case
it helps someone else:
1. I added the following two lines to my S3 settings:
from S3 import CallingFormat
AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
I don't really understand the above line, so I can't comment on why it
might be useful. It is from the django-storages documentation.
2. I tweaked my wsgi file a bit. It now reads as follows:
from __future__ import unicode_literals
import os
import sys
import site
# Virtual environment on Python path
site.addsitedir('/home/rosslaird/.virtualenvs/mezzanine3/lib/python2.6/site-packages')
sys.path.insert(1, '/home/rosslaird/m3')
sys.path.append('/home/rosslaird')
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
settings_module = %s.settings % PROJECT_ROOT.split(os.sep)[-1]
os.environ.setdefault(DJANGO_SETTINGS_MODULE, settings_module)
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
I did not change my Apache settings. So, the two changes above are
pretty much all I did.
Now onto the compression issues.
(I still don't know if my wsgi settings reflect some basic
configuration issue with Mezzanine, even with S3 now working.)
On Friday, 14 March 2014 09:59:16 UTC-7, Ross Laird wrote:
I have been trying for quite some time to get my static files onto
Amazon S3, and I just keep running into show-stopping issues. And I think
that my problems with S3 have revealed a flaw in my basic Mezzanine
configuration. Once I activate the S3 setup for static files, I get an
error like this:
UncompressableFileError: 'css/animate.css' could not be found in the
COMPRESS_ROOT '/home/rosslaird/static' or with staticfiles.
The folder 'rosslaird/static' does not exist and should not be part of
my Mezzanine configuration. On the other hand, my site runs just fine
(until I add the S3 configuration). I expect that 'static' is being
appended at runtime, and that '/home/rosslaird' is the offending part. It
does appear in my wsgi file:
from __future__ import unicode_literals
# Virtual environment on Python path
import site
site.addsitedir('/home/rosslaird/.virtualenvs/
mezzanine3/lib/python2.6/site-packages')
import os, sys
sys.path.insert(0, '/home/rosslaird/m3/zeni_core')
sys.path.insert(1, '/home/rosslaird/m3')
sys.path.append('/home/rosslaird')
os.environ['DJANGO_SETTINGS_MODULE'] = 'm3.settings'
import django.core.handlers.wsgi
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
The offending folder also appears in my apache configuration, but I
think that the actual problem may be in the wsgi settings above. Or, at
least I should find out if the above is broken first, before looking at
Apache as the culprit.
Whatever the cause, this issue also results (with the S3 settings
activated) in django-compressor looking for files in one folder above the
place where the files actually are. For example, I've received various
error messages in which django-compressor looks for 'css/whatever.css'
rather than 'static/css/whatever.css'. But every way that I've tried to
change the paths for djangoo-compressor to search the proper path seems
not
to work. And my S3 paths and settings seem correct:
AWS_SECRET_ACCESS_KEY = 'my_key'
AWS_ACCESS_KEY_ID = 'my_other_key'
AWS_STORAGE_BUCKET_NAME = 'ral_mezzanine'
AWS_QUERYSTRING_AUTH = False
STATICFILES_STORAGE =