Skip to content

Instantly share code, notes, and snippets.

@dmpayton
Created September 13, 2011 19:11
Show Gist options
  • Save dmpayton/1214764 to your computer and use it in GitHub Desktop.
Save dmpayton/1214764 to your computer and use it in GitHub Desktop.
django-celery + redis settings
## Store the core redis info in a dict so we can easily use redis-py later on:
## r = redis.StrictRedis(**settings.REDIS)
REDIS = {
'host': 'localhost',
'port': 6379,
'db': 0, ## General use goes to DB 0
'password': None,
'socket_timeout': None,
'connection_pool': None,
'charset': 'utf-8',
'errors': 'strict',
'unix_socket_path': None
}
## Broker
# BROKER_URL = 'redis://%s:%d/1' % (REDIS['host'], REDIS['port']) # Celery 2.4
BROKER_TRANSPORT = 'redis'
BROKER_HOST = REDIS['host']
BROKER_PORT = REDIS['port']
BROKER_VHOST = '1' ## DB1 for celery stuff
## Results backend
CELERY_RESULT_BACKEND = 'redis'
CELERY_REDIS_HOST = REDIS['host']
CELERY_REDIS_PORT = REDIS['port']
CELERY_REDIS_DB = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment