I'm having some trouble getting mezzanine working with s3boto.s3botoStorage
*I'm using:*
- Django==1.8.2
- mezzanine==4.0.1
- django-storages-redux==1.3.2
- boto==2.39.0
*My Config:*
####################
# STORAGE SETTINGS #
####################
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME = os.getenv('AWS_STORAGE_BUCKET_NAME')
AWS_PRELOAD_METADATA = True
AWS_LOCATION = 'static'
AWS_QUERYSTRING_AUTH = False
#########
# PATHS #
#########
STATIC_URL = S3_URL + 'static/'
MEDIA_URL = STATIC_URL + 'media/'
MEDIA_ROOT = ''
*The Result:*
- Files get uploaded to STATIC_URL/uploads
- **thumbnails** look like MEDIA_URL + "uploads/PATH/TO/RESOURCE"
- Original resource is uploaded w/ improper content type (app/stream not
png in this case).
*What I've Tried:*
- *Changing MEDIA_ROOT = MEDIA_URL.*
Traceback:
File "/usr/local/lib/python3.3/site-packages/django/core/handlers/base.py"
in get_response
132. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File
"/usr/local/lib/python3.3/site-packages/django/contrib/auth/decorators.py"
in _wrapped_view
22. return view_func(request, *args, **kwargs)
File
"/usr/local/lib/python3.3/site-packages/django/views/decorators/cache.py"
in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python3.3/site-packages/filebrowser_safe/views.py" in
browse
88. path = get_path(query.get('dir', ''))
File "/usr/local/lib/python3.3/site-packages/filebrowser_safe/functions.py"
in get_path
116. if path.startswith('.') or os.path.isabs(path) or not
default_storage.isdir(os.path.join(get_directory(), path)):
File "/usr/local/lib/python3.3/site-packages/filebrowser_safe/functions.py"
in get_directory
35. if not default_storage.isdir(fullpath):
File "/usr/local/lib/python3.3/site-packages/filebrowser_safe/storage.py"
in isdir
81. if self.isfile(name):
File "/usr/local/lib/python3.3/site-packages/filebrowser_safe/storage.py"
in isfile
72. return self.exists(name) and
self.entries[self._normalize_name(self._clean_name(name))].size > 0
File "/usr/local/lib/python3.3/site-packages/storages/backends/s3boto.py"
in exists
438. name = self._normalize_name(self._clean_name(name))
File "/usr/local/lib/python3.3/site-packages/storages/backends/s3boto.py"
in _normalize_name
361. name)
Exception Type: SuspiciousOperation at /admin/media-library/browse/
Exception Value: Attempted access to
'https:/s3.amazonaws.com/{MY_BUCKET}/static/media/uploads/' denied
- *Setting FILEBROWSER_DIRECTORY = 'media/uploads'*
Breaks the thumbnail links and duplicates the media directory like so >
https:/s3.amazonaws.com/{MY_BUCKET}/static/media/*media/*
uploads/filename.jpg
- *Setting MEDIA_URL = STATIC_URL*
Obvious fail, django doesn't allow for this.
Am i missing something? or is filebrowser_safe trying to upload to
STATIC_URL/uploads and saving the path in the model as MEDIA_ROOT/uploads
--
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.