Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-s3-folder-storage

How to install django-s3-folder-storage

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-s3-folder-storage
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.1 Available View build log
 
Dependencies
Depended by
Lastest release
version 0.1 on Jan 9th, 2014

Quick extension of django-storages' S3BotoStorage to allow separate folders for uploaded and static media within an S3 bucket.

Installation

Use pip to install from PyPI:

pip install django-s3-folder-storage

Add s3_folder_storage to your settings.py file:

INSTALLED_APPS = (
... 's3_folder_storage', ...

System Message: WARNING/2 (<string>, line 19)

Definition list ends without a blank line; unexpected unindent.

)

Configuration

You are essentially using django-storages for S3 hosting, so you will be using their settings. The two settings that are specific to django-s3-folder-storage are DEFAULT_S3_PATH and STATIC_S3_PATH.

Here's an example:

DEFAULT_FILE_STORAGE = 's3_folder_storage.s3.DefaultStorage' DEFAULT_S3_PATH = "media" STATICFILES_STORAGE = 's3_folder_storage.s3.StaticStorage' STATIC_S3_PATH = "static" AWS_ACCESS_KEY_ID = {{ your key id here }} AWS_SECRET_ACCESS_KEY = {{ your secret key here }} AWS_STORAGE_BUCKET_NAME = {{ your bucket name here }}

MEDIA_ROOT = '/%s/' % DEFAULT_S3_PATH MEDIA_URL = '//s3.amazonaws.com/%s/media/' % AWS_STORAGE_BUCKET_NAME STATIC_ROOT = "/%s/" % STATIC_S3_PATH STATIC_URL = '//s3.amazonaws.com/%s/static/' % AWS_STORAGE_BUCKET_NAME ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'

Contributing

Think this needs something else? To contribute to django-s3-folder-storage create a fork on github. Clone your fork, make some changes, and submit a pull request.

Subscribe to package updates

Last updated Jan 9th, 2014

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.