Mercurial > public > queues
changeset 7:d8ee2a6d318e
Change django settings access to use getattr. Thanks, James.
author | mcroydon |
---|---|
date | Thu, 08 Jan 2009 17:58:04 +0000 |
parents | 6a05de0f37c1 |
children | 74af5dd2ae36 |
files | queues/__init__.py queues/backends/__init__.py queues/backends/memcached.py queues/backends/sqs.py |
diffstat | 4 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/queues/__init__.py Thu Jan 08 15:40:25 2009 +0000 +++ b/queues/__init__.py Thu Jan 08 17:58:04 2009 +0000 @@ -37,7 +37,7 @@ # If set both places, django takes precedence. try: from django.conf import settings - BACKEND = settings.get('QUEUE_BACKEND', None) + BACKEND = getattr(settings, 'QUEUE_BACKEND', None) except: BACKEND = os.environ.get('QUEUE_BACKEND')
--- a/queues/backends/__init__.py Thu Jan 08 15:40:25 2009 +0000 +++ b/queues/backends/__init__.py Thu Jan 08 17:58:04 2009 +0000 @@ -7,7 +7,7 @@ # If set both places, django takes precedence. try: from django.conf import settings - BACKEND = settings.get('QUEUE_BACKEND', None) + BACKEND = getattr(settings, 'QUEUE_BACKEND', None) except: BACKEND = os.environ.get('QUEUE_BACKEND', None)
--- a/queues/backends/memcached.py Thu Jan 08 15:40:25 2009 +0000 +++ b/queues/backends/memcached.py Thu Jan 08 17:58:04 2009 +0000 @@ -19,7 +19,7 @@ try: from django.conf import settings - CONN = settings.get('QUEUE_MEMCACHE_CONNECTION', None) + CONN = getattr(settings, 'QUEUE_MEMCACHE_CONNECTION', None) except: CONN = os.environ.get('QUEUE_MEMCACHE_CONNECTION', None)
--- a/queues/backends/sqs.py Thu Jan 08 15:40:25 2009 +0000 +++ b/queues/backends/sqs.py Thu Jan 08 17:58:04 2009 +0000 @@ -17,8 +17,8 @@ try: from django.conf import settings - KEY = settings.get('AWS_ACCESS_KEY_ID', None) - SECRET = settings.get('AWS_SECRET_ACCESS_KEY', None) + KEY = getattr(settings, 'AWS_ACCESS_KEY_ID', None) + SECRET = getattr(settings, 'AWS_SECRET_ACCESS_KEY', None) except: KEY = os.environ.get('AWS_ACCESS_KEY_ID', None) SECRET = os.environ.get('AWS_SECRET_ACCESS_KEY', None)