You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
963 B
33 lines
963 B
import logging
|
|
|
|
from django.apps import AppConfig
|
|
from django.conf import settings
|
|
|
|
from haystack import connection_router, connections
|
|
from haystack.utils import loading
|
|
|
|
|
|
class HaystackConfig(AppConfig):
|
|
name = "haystack"
|
|
signal_processor = None
|
|
stream = None
|
|
|
|
def ready(self):
|
|
# Setup default logging.
|
|
log = logging.getLogger("haystack")
|
|
self.stream = logging.StreamHandler()
|
|
self.stream.setLevel(logging.INFO)
|
|
log.addHandler(self.stream)
|
|
|
|
# Setup the signal processor.
|
|
if not self.signal_processor:
|
|
signal_processor_path = getattr(
|
|
settings,
|
|
"HAYSTACK_SIGNAL_PROCESSOR",
|
|
"haystack.signals.BaseSignalProcessor",
|
|
)
|
|
signal_processor_class = loading.import_class(signal_processor_path)
|
|
self.signal_processor = signal_processor_class(
|
|
connections, connection_router
|
|
)
|