mtigas/django-medusa — pull request #4 by jimray (2012-08-22 23:05:38+00:00)
Title: Allow for medusa-specific AWS buckets

Currently, Medusa uses the same config variables that other S3
utilities use. This means using the same S3 bucket for file uploads,
for instance, that Medusa would use for its static site. It's possible
that a Medusa user may want to specify one S3 bucket for her static
site and another for file storages, for instance.

This patch introduces an optional configuration variable called
MEDUSA_AWS_STORAGE_BUCKET_NAME. If this variable is set, Medusa will
use it instead of the standard S3 bucket. If there is no
MEDUSA_AWS_STORAGE_BUCKET_NAME set, then Medusa will fall back to the
standard AWS_STORAGE_BUCKET_NAME configuration variable.

This code uses conditional expressions, which requires Python 2.5 (
http://docs.python.org/whatsnew/2.5.html#pep-308-conditional-expressions
). Since Django 1.4 itself requires Python 2.5, that seems ok, but if
Medusa needs to support older versions of Python, the conditional
expressions can be rewritten as standard if statements.

I imagine this could be extended to allow for other custom AWS
credentials, e.g. MEDUSA_AWS_ACCESS_KEY but that scenario seems less
likely than the desire to have the static site in one bucket and user
uploaded files in another.