Fix urllib.parse issue.

master
Nick Sergeant 2017-09-18 11:22:08 -04:00
parent 0b6072e3d3
commit f319ac8dca
1 changed files with 3 additions and 9 deletions

View File

@ -1,10 +1,6 @@
import dj_database_url
import os
try:
from urlparse import urlparse
except ImportError:
from urllib import parse as urlparse
import urllib
if 'DATABASE_URL' in os.environ:
@ -13,14 +9,12 @@ if 'DATABASE_URL' in os.environ:
if 'SEARCHBOX_SSL_URL' in os.environ:
es = urlparse(os.environ.get('SEARCHBOX_SSL_URL'))
port = es.port or 443
es = urllib.parse(os.environ.get('SEARCHBOX_SSL_URL'))
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': es.scheme + '://' + es.hostname + ':' + str(port),
'URL': es.scheme + '://' + es.hostname + ':443',
'INDEX_NAME': 'snipts',
},
}