mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 03:42:11 +01:00 
			
		
		
		
	Haystack may be used in dev mode if we have an ElasticSearch URL
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		@@ -24,7 +24,6 @@ PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
 | 
			
		||||
 | 
			
		||||
ADMINS = [("Emmy D'Anello", "emmy.danello@animath.fr")]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Quick-start development settings - unsuitable for production
 | 
			
		||||
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
 | 
			
		||||
 | 
			
		||||
@@ -38,7 +37,6 @@ SITE_ID = 1
 | 
			
		||||
 | 
			
		||||
ALLOWED_HOSTS = ['*']
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Application definition
 | 
			
		||||
 | 
			
		||||
INSTALLED_APPS = [
 | 
			
		||||
@@ -122,7 +120,6 @@ FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
 | 
			
		||||
ASGI_APPLICATION = 'tfjm.asgi.application'
 | 
			
		||||
WSGI_APPLICATION = 'tfjm.wsgi.application'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Password validation
 | 
			
		||||
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
 | 
			
		||||
 | 
			
		||||
@@ -178,7 +175,6 @@ USE_TZ = True
 | 
			
		||||
 | 
			
		||||
LOCALE_PATHS = [os.path.join(BASE_DIR, "locale")]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Static files (CSS, JavaScript, Images)
 | 
			
		||||
# https://docs.djangoproject.com/en/3.0/howto/static-files/
 | 
			
		||||
 | 
			
		||||
@@ -203,7 +199,10 @@ DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap5.html'
 | 
			
		||||
 | 
			
		||||
HAYSTACK_CONNECTIONS = {
 | 
			
		||||
    'default': {
 | 
			
		||||
        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
 | 
			
		||||
        'ENGINE': 'haystack.backends.elasticsearch7_backend.Elasticsearch7SearchEngine'
 | 
			
		||||
        if os.getenv("HAYSTACK_INDEX_NAME", None) else 'haystack.backends.simple_backend.SimpleEngine',
 | 
			
		||||
        'URL': 'http://elasticsearch:9200/',
 | 
			
		||||
        'INDEX_NAME': os.getenv('HAYSTACK_INDEX_NAME', 'inscription-tfjm'),
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -274,6 +273,6 @@ CHANNEL_LAYERS = {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if os.getenv("TFJM_STAGE", "dev") == "prod":  # pragma: no cover
 | 
			
		||||
    from .settings_prod import *    # noqa: F401,F403
 | 
			
		||||
    from .settings_prod import *  # noqa: F401,F403
 | 
			
		||||
else:
 | 
			
		||||
    from .settings_dev import *     # noqa: F401,F403
 | 
			
		||||
    from .settings_dev import *  # noqa: F401,F403
 | 
			
		||||
 
 | 
			
		||||
@@ -38,12 +38,4 @@ CHANNEL_LAYERS = {
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
HAYSTACK_CONNECTIONS = {
 | 
			
		||||
    'default': {
 | 
			
		||||
        'ENGINE': 'haystack.backends.elasticsearch7_backend.Elasticsearch7SearchEngine',
 | 
			
		||||
        'URL': 'http://elasticsearch:9200/',
 | 
			
		||||
        'INDEX_NAME': os.getenv('HAYSTACK_INDEX_NAME', 'inscription-tfjm'),
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user