Skip to content

Commit

Permalink
Merge pull request #114 from boilerroomtv/multipart-upload
Browse files Browse the repository at this point in the history
Multipart-upload using EvaporateJS
  • Loading branch information
bradleyg authored Aug 1, 2017
2 parents 14d8865 + a62bfeb commit 9d40aaa
Show file tree
Hide file tree
Showing 11 changed files with 470 additions and 495 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ example/db.sqlite3
example/example/settings-test.py
/build
.idea
/s3direct/static/s3direct/js/bundled.js
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ Install with Pip:

```pip install django-s3direct```

### Backwards-Compatiblity

With 1.0.0 supporting multipart-upload, most of the internals have been
changed, a new endpoint has been added, and support has been dropped for
old style positional settings. There are also new requirements to allow
`GET` and `HEAD` cross-origin requests to S3, as well as
the `ETAG` header. Django compatibility has been raised to `>=1.8`.

If you used any of these features or relied on the previous behaviour,
it's recommended that you pin `django-s3direct` to `<1.0` until you
can test the new version in your project:

```sh
pip install 'django-s3direct <1.0'
```


## AWS Setup

### Access Credentials
Expand All @@ -32,7 +49,13 @@ in effect that grants permission to upload to S3:
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:PutObjectAcl"],
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:ListMultipartUploadParts",
"s3:AbortMultipartUpload"
],
"Resource": "arn:aws:s3:::your-bucket-name/*"
}
]
Expand Down Expand Up @@ -66,9 +89,12 @@ Setup a CORS policy on your S3 bucket.
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>http://yourdomain.com:8080</AllowedOrigin>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<ExposeHeader>ETag</ExposeHeader>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Expand Down
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "django-s3direct",
"version": "0.4.10",
"description": "Add direct uploads to S3 functionality with a progress bar to file input fields.",
"directories": {
"example": "example"
},
"dependencies": {
"js-cookie": "^2.1.4",
"evaporate": "^2.1.1",
"sha.js": "^2.4.8",
"spark-md5": "^3.0.0"
},
"devDependencies": {
"browserify": "^14.3.0",
"watchify": "^3.9.0"
},
"scripts": {
"test": "python runtests.py",
"build": "browserify s3direct/static/s3direct/js/scripts.js -o s3direct/static/s3direct/js/bundled.js",
"watch": "watchify s3direct/static/s3direct/js/scripts.js -o s3direct/static/s3direct/js/bundled.js --debug --verbose"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bradleyg/django-s3direct.git"
},
"keywords": [
"django",
"S3",
"file",
"upload"
],
"author": "Bradley Griffiths",
"license": "MIT",
"bugs": {
"url": "https://github.com/bradleyg/django-s3direct/issues"
},
"homepage": "https://github.com/bradleyg/django-s3direct#readme"
}
Loading

0 comments on commit 9d40aaa

Please sign in to comment.