Skip to main content
Help us improve Python packaging – donate today!

Add direct uploads to S3 functionality with a progress bar to file input fields within Django admin.

Project Description

django-s3direct
===============

Upload files direct to S3 from Django
-------------------------------------


Add direct uploads to AWS S3 functionality with a progress bar to file input fields within Django admin.

![screenshot](https://raw.github.com/bradleyg/django-s3direct/master/screenshot.png)


## Installation

Install with Pip:

```pip install django-s3direct```

Currently only python 2.7 supported.

## S3 Setup

Setup a CORS policy on your S3 bucket.

```xml
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
```

## Django Setup

### Settings.py

```python
INSTALLED_APPS = [
...
's3direct',
...
]

AWS_SECRET_ACCESS_KEY = ''
AWS_ACCESS_KEY_ID = ''
AWS_STORAGE_BUCKET_NAME = ''
S3DIRECT_ENDPOINT = '' # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
S3DIRECT_DIR = 's3direct' # (optional, default is 's3direct', location within the bucket to upload files)
S3DIRECT_UNIQUE_RENAME = False # (optional, default is 'False', gives the uploaded file a unique filename)
```

### urls.py

```python
urlpatterns = patterns('',
url(r'^s3direct/', include('s3direct.urls')),
)
```

### models.py


```python
from django.db import models
from s3direct.fields import S3DirectField

class Example(models.Model):
thumbnail = S3DirectField(upload_to='s3direct')
# 'upload_to' is an optional argument
```

You may need to run `collectstatic` before `s3direct` will work correctly on your public website:

```bash
python manage.py collectstatic
````

[![Build Status](https://secure.travis-ci.org/bradleyg/django-s3direct.png)](http://travis-ci.org/bradleyg/django-s3direct)

Release history Release notifications

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1.dev1

History Node

0.4.10

History Node

0.4.9

History Node

0.4.8

History Node

0.4.7

History Node

0.4.6

History Node

0.4.5

History Node

0.4.4

History Node

0.4.2

History Node

0.4.1

History Node

0.4.0

History Node

0.3.15

History Node

0.3.14

History Node

0.3.13

History Node

0.3.12

History Node

0.3.11

History Node

0.3.10

History Node

0.3.9

History Node

0.3.8

History Node

0.3.7

History Node

0.3.6

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.2.8

History Node

0.2.7

History Node

0.2.6

History Node

0.2.5

History Node

0.2.4

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

This version
History Node

0.1.6

History Node

0.1.5

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

History Node

0.0.9

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-s3direct-0.1.6.macosx-10.9-intel.exe (133.6 kB) Copy SHA256 hash SHA256 Windows Installer any Jan 10, 2014
django-s3direct-0.1.6.tar.gz (62.3 kB) Copy SHA256 hash SHA256 Source None Jan 10, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page