Created
September 5, 2014 02:32
-
-
Save nz/e46a9ab825281918dd39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ES_URL = urlparse(os.environ.get('BONSAI_URL') or 'http://127.0.0.1:9200/') | |
HAYSTACK_CONNECTIONS = { | |
'default': { | |
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', | |
'URL': ES_URL.scheme + '://' + ES_URL.hostname + ':80', | |
'INDEX_NAME': 'haystack', | |
}, | |
} | |
if ES_URL.username: | |
HAYSTACK_CONNECTIONS['default']['KWARGS'] = {"http_auth": ES_URL.username + ':' + ES_URL.password} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Nick,
The ticket at Heroku is closed, so I'll reply here.
This code worked, thanks a lot!
One question: while testing this, at some point I removed the last two lines, and everything worked regardless. Isn't it supposed not to work without the username and password?
Cheers,
Alen