Fixes: 1) Remove unnecessary wildcard imports in settings files; 2) Add missing imports for `getenv`, `DEBUG`, and other constants; 3) Fix logger usage in middleware to align with `django.request`. Extra: 1) Refactor settings files for readability and consistency; 2) Remove outdated `noqa` comments; 3) Minor formatting adjustments.
19 lines
526 B
Python
19 lines
526 B
Python
from os import getenv
|
|
|
|
from evibes.settings import DEBUG
|
|
|
|
ELASTICSEARCH_DSL = {
|
|
"default": {
|
|
"hosts": ["http://elasticsearch:9200"],
|
|
"http_auth": ("elastic", getenv("ELASTIC_PASSWORD")),
|
|
"verify_certs": False,
|
|
"timeout": 30,
|
|
"ssl_show_warn": False,
|
|
"max_retries": 3,
|
|
"retry_on_timeout": True,
|
|
},
|
|
}
|
|
|
|
ELASTICSEARCH_DSL_AUTOSYNC = DEBUG
|
|
ELASTICSEARCH_DSL_PARALLEL = True
|
|
ELASTICSEARCH_DSL_SIGNAL_PROCESSOR = "django_elasticsearch_dsl.signals.CelerySignalProcessor"
|