From 7cedbef7cb868fec393924159ff2ada14778c6a9 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Mon, 20 Oct 2014 14:16:12 -0400 Subject: [PATCH] Working on Heroku integration. --- settings.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/settings.py b/settings.py index 91ccc3b..bae3259 100644 --- a/settings.py +++ b/settings.py @@ -4,6 +4,12 @@ if 'DATABASE_URL' in os.environ: DATABASES = { 'default': dj_database_url.config() } + HAYSTACK_CONNECTIONS = { + 'default': { + 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', + 'URL': os.environ.get('BONSAI_URL', ''), + }, + } else: DATABASES = { 'default': { @@ -15,6 +21,11 @@ else: 'PORT': '' } } + HAYSTACK_CONNECTIONS = { + 'default': { + 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', + }, + } ABSOLUTE_URL_OVERRIDES = { 'auth.user': lambda u: "/%s/" % u.username, } ACCOUNT_ACTIVATION_DAYS = 0 @@ -28,7 +39,6 @@ CSRF_COOKIE_SECURE = False DEBUG = os.environ.get('DEBUG', False) DEFAULT_FROM_EMAIL = 'nick@snipt.net' EMAIL_BACKEND = 'postmark.django_backend.EmailBackend' -HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', }, } HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' INTERCOM_SECRET_KEY = os.environ.get('INTERCOM_SECRET_KEY', '') INTERNAL_IPS = ('127.0.0.1',)