Skip to main content

AWS S3 Bucket file storage system for Django applications

Project description

Django S3 Storage

AWS S3 Bucket file storage system for Django applications.

Setup

pip install django-aws-s3-storage

Configuration

Add django_aws_s3_storage to your INSTALLED_APPS setting.

INSTALLED_APPS = [
    ...
    'django_aws_s3_storage',
    ...
]

Set DEFAULT_FILE_STORAGE setting.

DEFAULT_FILE_STORAGE = 'django_aws_s3_storage.storage.S3Storage'

Add DJANGO_AWS_S3_STORAGE specific settings.

DJANGO_AWS_S3_STORAGE = {
    'AWS_ACCESS_KEY_ID': 'YOUR_ACCESS_KEY_ID',
    'AWS_ACCESS_SECRET_KEY': 'YOUR_SECRET_KEY',
    'BUCKET_NAME': 'BUCKET_NAME',
}

Usage

After finishing the configuration steps, in just add a file-like field to one your models, as the example bellow

from django.db import models


class MyModel(models.Model):
    my_file = models.FileField()

Links

How to handle file uploads in Django

Managing files in Django

Project details


Download files

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

Source Distribution

django-aws-s3-storage-0.2.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page