Answer the question
In order to leave comments, you need to log in
KeyError Django where to dig?
Good afternoon.
When I try to start the test server (py manage.py runserver), I get the following error: KeyError: 'ELASTIC_HOST'
And it refers to:
...line 147, in <module>
'URL': ':'.join([ENV_DICT['ELASTIC_HOST'], str(ENV_DICT['ELASTIC_PORT'])]),
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'elasticstack.backends.ConfigurableElasticSearchEngine',
'URL': ':'.join([ENV_DICT['ELASTIC_HOST'], str(ENV_DICT['ELASTIC_PORT'])]),
'INDEX_NAME': 'aden',
},
}
Answer the question
In order to leave comments, you need to log in
ENV_DICT ='ЗНАЧЕНИЕ' ./manage.py runserver
apparently, you need to set an environment variable ... or disable elastic
Default config looks like this
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
'URL': 'http://localhost:9001/solr/default',
'TIMEOUT': 60 * 5,
'INCLUDE_SPELLING': True,
'BATCH_SIZE': 100,
'EXCLUDED_INDEXES': ['thirdpartyapp.search_indexes.BarIndex'],
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question