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 = 'storages.backends.s3boto.S3BotoStorage'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATIC_FILES_BUCKET = 'ral_mezzanine'
S3_URL = 'https://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
STATIC_ROOT = 'static'
COMPRESS_URL = S3_URL
STATIC_URL = COMPRESS_URL
MEDIA_URL = STATIC_URL + 'media/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
COMPRESS_ENABLED = True
COMPRESS_ROOT = STATIC_ROOT
COMPRESS_STORAGE = STATICFILES_STORAGE
COMPRESS_OFFLINE = False

The above settings are in a separate file that is only imported when I 
activate S3 (from a line in local_settings.py). So, normally, all of the 
above settings that are also part of the default Mezzanine setup are set to 
defaults in local_settings.py or settings.py. 
I can access S3 just fine, from the django-shell, so it's not an access 
problem. At this point, I've narrowed it down to what I think is the actual 
issue: that folder reference.
Can anybody help me sort this out?

Thanks in advance.

Ross

-- 
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