# HG changeset patch # User Brian Neal # Date 1420334343 21600 # Node ID bab6b1eac1e2fbfe171f6969bc248d5422acd17a # Parent d5d8e90d08b5b4a48b71ef27b1ab7322b3247668# Parent a423e8fd082ddcd3190635a297249daa6fb79fc2 Merge with upstream. diff -r d5d8e90d08b5 -r bab6b1eac1e2 core/services.py --- a/core/services.py Thu Dec 25 17:28:48 2014 -0600 +++ b/core/services.py Sat Jan 03 19:19:03 2015 -0600 @@ -11,11 +11,15 @@ REDIS_HOST = getattr(settings, 'REDIS_HOST', 'localhost') REDIS_PORT = getattr(settings, 'REDIS_PORT', 6379) REDIS_DB = getattr(settings, 'REDIS_DB', 0) +REDIS_SOCKET = getattr(settings, 'REDIS_UNIX_SOCKET', None) -def get_redis_connection(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB): +def get_redis_connection(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB, + unix_socket_path=REDIS_SOCKET): """ Create and return a Redis connection using the supplied parameters. """ + if unix_socket_path: + return redis.StrictRedis(unix_socket_path=unix_socket_path, db=db) return redis.StrictRedis(host=host, port=port, db=db) diff -r d5d8e90d08b5 -r bab6b1eac1e2 requirements.txt --- a/requirements.txt Thu Dec 25 17:28:48 2014 -0600 +++ b/requirements.txt Sat Jan 03 19:19:03 2015 -0600 @@ -9,7 +9,7 @@ bleach==1.4 pytz==2013b queued-search==2.1.0 -queues==0.6.3 +hg+https://bgneal@bitbucket.org/bgneal/queues@862e884#egg=queues redis==2.7.2 repoze.timeago==0.5 -e git+https://github.com/notanumber/xapian-haystack.git@37add92bc43fe50bf165e91f370269c26272f1eb#egg=xapian_haystack-dev diff -r d5d8e90d08b5 -r bab6b1eac1e2 requirements_dev.txt --- a/requirements_dev.txt Thu Dec 25 17:28:48 2014 -0600 +++ b/requirements_dev.txt Sat Jan 03 19:19:03 2015 -0600 @@ -10,7 +10,7 @@ bleach==1.4 pytz==2013b queued-search==2.1.0 -queues==0.6.3 +hg+https://bgneal@bitbucket.org/bgneal/queues@862e884#egg=queues redis==2.7.2 repoze.timeago==0.5 -e git+https://github.com/notanumber/xapian-haystack.git@37add92bc43fe50bf165e91f370269c26272f1eb#egg=xapian_haystack-master diff -r d5d8e90d08b5 -r bab6b1eac1e2 sg101/settings/base.py --- a/sg101/settings/base.py Thu Dec 25 17:28:48 2014 -0600 +++ b/sg101/settings/base.py Sat Jan 03 19:19:03 2015 -0600 @@ -202,14 +202,13 @@ ####################################################################### # Redis integration & settings ####################################################################### -REDIS_HOST = 'localhost' -REDIS_PORT = 6379 +REDIS_UNIX_SOCKET = '/var/run/redis/redis.sock' REDIS_DB = 0 ####################################################################### # Celery integration & settings ####################################################################### -BROKER_URL = 'redis://localhost:6379/1' +BROKER_URL = 'redis+socket:///var/run/redis/redis.sock?virtual_host=1' BROKER_POOL_LIMIT = 10 CELERY_TIMEZONE = TIME_ZONE @@ -301,7 +300,7 @@ # Asynchronous settings (queues, queued_search, redis, celery, etc) ####################################################################### QUEUE_BACKEND = 'redisd' -QUEUE_REDIS_CONNECTION = 'localhost:6379' +QUEUE_REDIS_UNIX_SOCKET = REDIS_UNIX_SOCKET QUEUE_REDIS_DB = 0 ####################################################################### diff -r d5d8e90d08b5 -r bab6b1eac1e2 sg101/settings/local.py --- a/sg101/settings/local.py Thu Dec 25 17:28:48 2014 -0600 +++ b/sg101/settings/local.py Sat Jan 03 19:19:03 2015 -0600 @@ -12,6 +12,9 @@ 'NAME': SECRETS['DB_NAME'], 'USER': SECRETS['DB_USER'], 'PASSWORD': SECRETS['DB_PASSWORD'], + 'OPTIONS': { + 'unix_socket': '/var/run/mysqld/mysqld.sock', + }, }, } diff -r d5d8e90d08b5 -r bab6b1eac1e2 sg101/settings/production.py --- a/sg101/settings/production.py Thu Dec 25 17:28:48 2014 -0600 +++ b/sg101/settings/production.py Sat Jan 03 19:19:03 2015 -0600 @@ -14,6 +14,9 @@ 'NAME': SECRETS['DB_NAME'], 'USER': SECRETS['DB_USER'], 'PASSWORD': SECRETS['DB_PASSWORD'], + 'OPTIONS': { + 'unix_socket': '/var/run/mysqld/mysqld.sock', + }, }, } @@ -33,7 +36,7 @@ CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': '127.0.0.1:11211', + 'LOCATION': 'unix:/var/run/memcached/memcached.sock', 'TIMEOUT': 600, 'KEY_PREFIX': 'sg101', }, diff -r d5d8e90d08b5 -r bab6b1eac1e2 sg101/templates/core/mp3comp_block.html --- a/sg101/templates/core/mp3comp_block.html Thu Dec 25 17:28:48 2014 -0600 +++ b/sg101/templates/core/mp3comp_block.html Sat Jan 03 19:19:03 2015 -0600 @@ -10,4 +10,5 @@ 2011 2012 2013 +2014 {% endblock %}