Exception Value: | Attempted access to '/app/backlash/media/uploads' denied. |
---|
Exception Value: | Attempted access to '/app/backlash/media/https:/myproject.s3.amazonaws.com/media/media/uploads' denied. |
---|
--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
########## S3 STATIC CONFIGURATION
DEFAULT_FILE_STORAGE = 'backlash.storage.S3ProtectedStorage'
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = get_env_setting('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = get_env_setting('AWS_SECRET_ACCESS_KEY')
AWS_STORAGE_BUCKET_NAME = get_env_setting('AWS_STORAGE_BUCKET_NAME')
AWS_MEDIA_BUCKET_NAME = get_env_setting('AWS_MEDIA_BUCKET_NAME')
STATIC_URL = 'https://%s.s3.amazonaws.com/static/' % AWS_STORAGE_BUCKET_NAME
MEDIA_URL = 'https://%s.s3.amazonaws.com/media/' % AWS_MEDIA_BUCKET_NAME
# Used to make sure that only changed files are uploaded with collectstatic
AWS_PRELOAD_METADATA = True
AWS_LOCATION = 'static'
AWS_QUERYSTRING_EXPIRE = 7200
#turns off https for static files (necessary)
AWS_QUERYSTRING_AUTH = False
########## S3 STATIC CONFIGURATION
Attempted access to '/home/darren/Projects/heroku/backlash_project/backlash/media/https:/authentictrendmedia.s3.amazonaws.com/media/uploads' denied.
'/home/darren/Projects/heroku/backlash_project/backlash/media/https:/authentictrendmedia.s3.amazonaws.com/media/uploads' denied.
########## S3 STATIC CONFIGURATION
MEDIA_ROOT = ''
# FILEBROWSER_DIRECTORY = MEDIA_URL + 'uploads/'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/media-library/browse/?ot=desc&o=date
Traceback:
File "/home/darren/.virtualenvs/bl/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
115. response = callback(request, *callback_args, **callback_kwargs)
File "/home/darren/.virtualenvs/bl/local/lib/python2.7/site-packages/django/contrib/admin/views/decorators.py" in _checklogin
17. return view_func(request, *args, **kwargs)
File "/home/darren/.virtualenvs/bl/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
89. response = view_func(request, *args, **kwargs)
File "/home/darren/.virtualenvs/bl/local/lib/python2.7/site-packages/filebrowser_safe/views.py" in browse
108. if fileobject.filetype == request.GET.get('filter_type', fileobject.filetype) and get_filterdate(request.GET.get('filter_date', ''), fileobject.date):
File "/home/darren/.virtualenvs/bl/local/lib/python2.7/site-packages/filebrowser_safe/base.py" in _date
85. self._date_stored = time.mktime(default_storage.modified_time(self.path).timetuple())
File "/home/darren/Projects/heroku/backlash_project/backlash/storages/backends/s3boto.py" in modified_time
455. return parse_ts_extended(entry.last_modified)
File "/home/darren/Projects/heroku/backlash_project/backlash/storages/backends/s3boto.py" in parse_ts_extended
39. rv = parse_ts(ts)
File "/home/darren/.virtualenvs/bl/lib/python2.7/site-packages/boto/utils.py" in parse_ts
390. ts = ts.strip()
Exception Type: AttributeError at /admin/media-library/browse/
Exception Value: 'NoneType' object has no attribute 'strip'
File "/home/darren/.virtualenvs/bl/local/lib/python2.7/site-packages/filebrowser_safe/base.py" in _date
85. self._date_stored = time.mktime(default_storage.modified_time(self.path).timetuple())
def modified_time(self, name):
name = self._normalize_name(self._clean_name(name))
entry = self.entries.get(name)
# only call self.bucket.get_key() if the key is not found
# in the preloaded metadata.
if entry is None:
entry = self.bucket.get_key(self._encode_name(name))
# Parse the last_modified string to a local datetime object.
return parse_ts_extended(entry.last_modified)
def modified_time(self, name):
name = self._normalize_name(self._clean_name(name))
entry = self.entries.get(name)
# only call self.bucket.get_key() if the key is not found
# in the preloaded metadata.
if entry is None:
entry = self.bucket.get_key(self._encode_name(name))
# Parse the last_modified string to a local datetime object.
if not entry.last_modified:
try:
entry.last_modified = datetime.datetime.now().strftime(ISO8601)
except ValueError:
entry.last_modified = datetime.datetime.now().strftime(ISO8601_MS)
return parse_ts_extended(entry.last_modified)
ThanksMarcos
--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
from storages.backends.s3boto import S3BotoStorage, parse_ts_extended
class MyS3BotoStorage(S3BotoStorage):
def modified_time(self, name):
name = self._normalize_name(self._clean_name(name))
entry = self.entries.get(name)
# only call self.bucket.get_key() if the key is not found
# in the preloaded metadata or if modified time stamp is empty.
if entry is None or not entry.last_modified:
entry = self.bucket.get_key(self._encode_name(name))
self._entries[name] = entry
# Parse the last_modified string to a local datetime object.
return parse_ts_extended(entry.last_modified)