diff --git a/eshop_project/settings/base.py b/eshop_project/settings/base.py index 6683899..e1602cd 100644 --- a/eshop_project/settings/base.py +++ b/eshop_project/settings/base.py @@ -228,7 +228,7 @@ LOGGING = { 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' }, - 'production_file': { + 'prod_file_handler': { 'level': 'ERROR', 'class': 'logging.handlers.RotatingFileHandler', 'filename': 'logs/eshop_main_prod.log', @@ -237,7 +237,7 @@ LOGGING = { 'formatter': 'main_formatter', 'filters': ['require_debug_false'] }, - 'debug_file': { + 'debug_file_handler': { 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', 'filename': 'logs/eshop_main_dev.log', @@ -249,7 +249,7 @@ LOGGING = { }, 'loggers': { 'django.request': { - 'handlers': ['mail_admins'], + 'handlers': ['mail_admins','prod_file_handler' if DEBUG else 'debug_file_handler'], 'level': 'ERROR', 'propagate': True } diff --git a/eshop_project/settings/celery.py b/eshop_project/settings/celery.py index a192086..baba91b 100644 --- a/eshop_project/settings/celery.py +++ b/eshop_project/settings/celery.py @@ -5,3 +5,8 @@ CELERY_RESULT_BACKEND = env.str('CELERY_RESULT_BACKEND') CELERY_ACCEPT_CONTENT = tuple(env.list("CELERY_ACCEPT_CONTENT")) CELERY_RESULT_SERIALIZER = env.str('CELERY_RESULT_SERIALIZER') CELERY_TASK_SERIALIZER = env.str('CELERY_TASK_SERIALIZER') + +if DEBUG: + CELERY_ALWAYS_EAGER = env.bool('CELERY_ALWAYS_EAGER') + CELERY_RDB_PORT = env.str('CELERY_RDB_PORT') + CELERY_RDBSIG=env.bool('CELERY_RDBSIG')