-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't seem to work with Amazon S3 #7
Comments
Is there any possibility someone could look into enabling S3 storage? Just looking at the other package I'm not sure I like their implementation. I much prefer the transparency of this app - any help on fixing this issue would be greatly appreciated as this app is exactly what I'm after. Thanks! |
Thanks for your feedback. I can look into it, but it might be beyond the scope of what this application should be doing. Are you currently using any custom s3 file storage extension for Django? For example, https://bitbucket.org/david/django-storages/ |
Yes I'm currently using django-storages and I get the feeling I'm also On Sat, Mar 16, 2013 at 7:59 AM, Zach Mathew notifications@github.comwrote:
|
I went to widgets.py to try and help with this and got in over my head fairly quickly, but I found settings.MEDIA_URL on line 22. With storages, settings.MEDIA_URL might not be the right thing to use here. At least for the existing image (if there is one), field.url should be used instead. |
I've not found a solution to this issue yet, unfortunately. I'm using django-storages and django-boto to upload media to an S3 bucket. I'm using the following options in my settings.py... any ideas? DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage' MEDIA_ROOT = '/media/' |
Has anyone had some time to look into this? I was playing around with things today but to no avail. I've included a traceback below. When I select an image it does actually upload it to my S3 bucket (I've deleted the images though, so the url in the traceback won't actually work) but something goes awry. The img tag is not created and then when hitting upload I'm thrown the following error. Seems like it's close to working but it can't sanitize the url properly or something. Traceback (most recent call last):
File "/opt/python/run/venv/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/views/generic/base.py", line 48, in view
return self.dispatch(request, *args, **kwargs)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/utils/decorators.py", line 25, in _wrapper
return bound_func(*args, **kwargs)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/contrib/auth/decorators.py", line 20, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/utils/decorators.py", line 21, in bound_func
return func(self, *args2, **kwargs2)
File "/opt/python/current/app/imagestore/views.py", line 212, in dispatch
return super(CreateAJAXImage, self).dispatch(*args, **kwargs)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/views/generic/base.py", line 69, in dispatch
return handler(request, *args, **kwargs)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/views/generic/edit.py", line 172, in post
return super(BaseCreateView, self).post(request, *args, **kwargs)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/views/generic/edit.py", line 137, in post
if form.is_valid():
File "/opt/python/run/venv/lib/python2.6/site-packages/django/forms/forms.py", line 124, in is_valid
return self.is_bound and not bool(self.errors)
File "/opt/python/run/venv/lib/python2.6/site-packages/django/forms/forms.py", line 115, in _get_errors
self.full_clean()
File "/opt/python/run/venv/lib/python2.6/site-packages/django/forms/forms.py", line 270, in full_clean
self._clean_fields()
File "/opt/python/run/venv/lib/python2.6/site-packages/django/forms/forms.py", line 281, in _clean_fields
value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))
File "/opt/python/current/app/ajax_upload/widgets.py", line 54, in value_from_datadict
raise AjaxUploadException(u'%s %s' % (_('File path not allowed:'), file_path))
AjaxUploadException: File path not allowed: https://aspacebetween-media.s3.amazonaws.com/ajax_uploads/c3178faa9ef648a78727e3033c80107d-209025_10151107767827670_2065077431_o.jpg?Signature=xVp%2B4jT%2B0vcrrk%2Fz1DFfLwDu0EQ%3D&Expires=1367814670&AWSAccessKeyId=AKIAIFA7EOMOBZD3HYBA |
I have also same problem , |
Fixes zmathew#7 If `MEDIA_URL` was set to `http://...` then the uploader would fail because the returned path from Amazon S3 is `https://..`. This commit fixes this by using `urlparse` instead to match the hostname and find the relative path.
Hello, I've been using this app in development and it works wonderfully if you store ajax-uploaded data locally. However, I just deployed a site that uses an Amazon S3 storage bucket and it doesn't play nice with Amazon S3. It thrown me a AjaxUploadException: File path not allowed error. Just a heads up :) Will look into how this package: https://github.com/GoodCloud/django-ajax-uploader handles S3 storage in the meantime. Thanks for the awesome package!
The text was updated successfully, but these errors were encountered: