X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/356ce56229b7439ae6f35f8f80e480bdfa8bff56..7e9be4e3962e1cccc43798d0507b2c82cd1d275c:/src/wolnelektury/settings/__init__.py diff --git a/src/wolnelektury/settings/__init__.py b/src/wolnelektury/settings/__init__.py index 8e0815b3f..f8451cc23 100644 --- a/src/wolnelektury/settings/__init__.py +++ b/src/wolnelektury/settings/__init__.py @@ -23,6 +23,22 @@ except ImportError: pass +# If Celery broker not configured, enable always-eager mode. +try: + CELERY_BROKER_URL +except NameError: + CELERY_TASK_ALWAYS_EAGER = True + + +# If SEARCH_INDEX not configured, disable the search. +try: + SOLR +except NameError: + NO_SEARCH_INDEX = True +else: + NO_SEARCH_INDEX = False + + try: SENTRY_DSN except NameError: @@ -32,3 +48,11 @@ else: dsn=SENTRY_DSN, integrations=[DjangoIntegration()] ) + + +# Dummy secret key for development. +try: + SECRET_KEY +except NameError: + if DEBUG: + SECRET_KEY = 'not-a-secret-key'