# HG changeset patch # User Brian Neal # Date 1425786708 21600 # Node ID 0743439863896ff5ca3b16ac1a0ea0e9ec31dd12 # Parent 147a66da9cbcf498e1400cde50fd8fbe59c38a2d More changes for Mac development. diff -r 147a66da9cbc -r 074343986389 sg101/celery.py --- 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. diff -r 147a66da9cbc -r 074343986389 sg101/settings/mac.py --- 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' diff -r 147a66da9cbc -r 074343986389 sg101/settings/test.py --- 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': {