Стартавая модель авторизации в приложении

This commit is contained in:
adm
2024-02-22 15:16:15 +03:00
parent bbe3fd7892
commit 645bddb07f
22 changed files with 744 additions and 1 deletions

49
config/logging.py Normal file
View File

@@ -0,0 +1,49 @@
import os
from config.local_settings import LOGS_DIR
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '{asctime} {levelname} {module} {process:d} {thread:d} '
'{message}',
'style': '{',
},
'simple': {
'format': '{asctime} {levelname} {message}',
'style': '{',
},
}, # formatters
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple',
},
'file': {
'level': 'DEBUG',
'formatter': 'verbose',
'class': 'logging.handlers.TimedRotatingFileHandler',
'filename': os.path.join(LOGS_DIR, "debug.log"),
'when': 'midnight',
'backupCount': 30,
},
}, # handlers
'loggers': {
'': { # root logger
'handlers': ['console', 'file'],
'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO').upper(),
},
'customauth': {
'handlers': ['console', 'file'],
'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG').upper(),
'propagate': False, # required to eliminate duplication on root
},
# 'app_name': {
# 'handlers': ['console', 'file'],
# 'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG').upper(),
# 'propagate': False, # required to eliminate duplication on root
# },
}, # loggers
} # logging