{
"info": {
"author": "Bradley Griffiths",
"author_email": "bradley.griffiths@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6"
],
"description": "django-s3direct\n===============\n\nUpload files directly to S3 (or compatible service) from Django.\n-------------------------------------\n\n[](https://travis-ci.org/bradleyg/django-s3direct)\n\nDirectly upload files to S3 and other compatible services (such as [Digital Ocean's Spaces](https://www.digitalocean.com/docs/spaces/)) with Django. \n
\n\n## Installation\n\nInstall with Pip: \n```pip install django-s3direct```\n\n## Access setup\n\n### When setting up access credentials you have two options:\n\n### Option 1:\n__Generate access credentials and add them directly to your Django settings__.\nIf using Amazon S3 you'll also need to create an IAM policy which grants\npermission to upload to your bucket for your newly created credentials.\nRemember to swap out __YOUR_BUCKET_NAME__ for your actual bucket.\n\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\n \"s3:GetObject\",\n \"s3:PutObject\",\n \"s3:PutObjectAcl\",\n \"s3:ListMultipartUploadParts\",\n \"s3:AbortMultipartUpload\"\n ],\n \"Resource\": \"arn:aws:s3:::YOUR_BUCKET_NAME/*\"\n }\n ]\n}\n```\n\n### Option 2:\n__Use the EC2 instance profile and its attached IAM role (AWS only)__ \nYou'll need to ensure the following trust policy is in place in addition to the\npolicy above. You'll also need the\n[boto3](https://github.com/boto/boto3) package installed.\n\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Principal\": {\n \"Service\": \"ec2.amazonaws.com\"\n },\n \"Action\": \"sts:AssumeRole\"\n }\n ]\n}\n```\n\n### CORS setup\n\nYou'll need to add a CORS policy on your bucket. Note the ETag header is\nimportant as it is used for multipart uploads. For more information see\n[here](https://github.com/TTLabs/EvaporateJS/wiki/Configuring-The-AWS-S3-Bucket).\nRemember to swap out YOURDOMAIN.COM in the example below, including port if\ndeveloping locally.\n\nIf using Digital Ocean Spaces you must upload the CORS config via the API/s3cmd\nCLI (as you can't add the ```ExposeHeader``` rule). See\n[here](https://www.digitalocean.com/community/questions/why-can-i-use-http-localhost-port-with-cors-in-spaces)\nfor more details.\n\n```xml\n