Skip to content
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

running example cat from localhost #29

Closed
johnjwatson opened this issue Nov 18, 2014 · 5 comments
Closed

running example cat from localhost #29

johnjwatson opened this issue Nov 18, 2014 · 5 comments

Comments

@johnjwatson
Copy link

I am trying to get my head around this package - but I seem to have run into trouble running the cat example. So, I am on Django 1.7, I migrate the models and runserver (usual stuff). Then:
localhost/form: shows me the form and I upload a *.pdf and nothing happens on the browser. The filename is displayed next to the choose file button and thats it.

Upon looking at the Network tab on Chrome, I see the following:
http://127.0.0.1:8000/s3direct/get_upload_params/ - POST - 403 - test/html - scripts.js:32

and line 32 shows:
req.send(data)

I suspect this has something to do with the localhost dev I am on?
Also, the POST seems to fail silently... Is that a good thing?
Thanks.

@bradleyg
Copy link
Owner

Do you mind clicking on the request and viewing the actual json response? Thanks.

@bradleyg
Copy link
Owner

The example was missing the CRSF token. My latest commit should fix that, thanks for reporting.

@johnjwatson
Copy link
Author

Awesome - Thanks so much Bradley! Works like a charm now, however, I seem to get:

AccessDenied
on : https://s3-eu-west-1.amazonaws.com/bucketname

My CORS config are exactly the same as in djangos3direct's github page.

Am I missing something here?

@bradleyg
Copy link
Owner

And your IAM keys definitely have access to your bucket?

@johnjwatson
Copy link
Author

I am really sorry - I was being stupid - I did not know that there were two policies - IAM policy and the bucket policy. It works perfectly now. Thank you!

bport pushed a commit to bport/django-s3direct that referenced this issue Aug 21, 2018
Restrict to Django 1.11 and 2.0, and update to Boto3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants