Mercurial > public > sg101
view gpp/core/services.py @ 568:7cec8d6f9581
For bitbucket issue #7, provide a bar graph indication of inbox and outbox
usage.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 10 Mar 2012 15:24:46 -0600 |
parents | f72ace06658a |
children |
line wrap: on
line source
""" This module provides a common way for the various apps to integrate with services that are installed at this site. """ from django.conf import settings import redis # Redis connection and database settings REDIS_HOST = getattr(settings, 'REDIS_HOST', 'localhost') REDIS_PORT = getattr(settings, 'REDIS_PORT', 6379) REDIS_DB = getattr(settings, 'REDIS_DB', 0) def get_redis_connection(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB): """ Create and return a Redis connection using the supplied parameters. """ return redis.StrictRedis(host=host, port=port, db=db)