Mercurial > public > sg101
changeset 903:074343986389
More changes for Mac development.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 07 Mar 2015 21:51:48 -0600 |
parents | 147a66da9cbc |
children | d4479ebbd118 |
files | sg101/celery.py sg101/settings/mac.py sg101/settings/test.py |
diffstat | 3 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/sg101/celery.py Sat Mar 07 14:11:50 2015 -0600 +++ b/sg101/celery.py Sat Mar 07 21:51:48 2015 -0600 @@ -8,8 +8,11 @@ from celery import Celery from django.conf import settings +if platform.system() == 'Darwin': + role = 'mac' +else: + role = 'production' if platform.node() == 'jaguar' else 'local' -role = 'production' if platform.node() == 'jaguar' else 'local' settings_val = 'sg101.settings.{}'.format(role) # set the default Django settings module for the 'celery' program.
--- a/sg101/settings/mac.py Sat Mar 07 14:11:50 2015 -0600 +++ b/sg101/settings/mac.py Sat Mar 07 21:51:48 2015 -0600 @@ -18,3 +18,4 @@ } REDIS_UNIX_SOCKET = '/tmp/redis.sock' +BROKER_URL = 'redis+socket:///tmp/redis.sock?virtual_host=1'
--- a/sg101/settings/test.py Sat Mar 07 14:11:50 2015 -0600 +++ b/sg101/settings/test.py Sat Mar 07 21:51:48 2015 -0600 @@ -3,6 +3,7 @@ """ import logging +import platform from sg101.settings.base import * @@ -21,8 +22,12 @@ # Use a different database in Redis for tests REDIS_DB = 14 QUEUE_REDIS_DB = 14 -BROKER_URL = 'redis://localhost:6379/15' CELERY_REDIS_DB = 15 +if platform.system() == 'Darwin': + REDIS_UNIX_SOCKET = '/tmp/redis.sock' + BROKER_URL = 'redis+socket:///tmp/redis.sock?virtual_host=15' +else: + BROKER_URL = 'redis+socket:///var/run/redis/redis.sock?virtual_host=15' DATABASES = { 'default': {