settings.py 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. import core.settings_vars as sv
  2. import os
  3. from django.contrib.messages import constants as message_constants
  4. from django.utils.translation import gettext_lazy as _
  5. from pathlib import Path
  6. import ldap
  7. from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
  8. ########
  9. #
  10. # Django
  11. #
  12. ########
  13. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  14. BASE_DIR = Path(__file__).resolve().parent.parent
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = sv.SECRET_KEY
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = sv.DEBUG
  19. CSRF_TRUSTED_ORIGINS = sv.CSRF_TRUSTED_ORIGINS
  20. ALLOWED_HOSTS = sv.ALLOWED_HOSTS
  21. INTERNAL_IPS = sv.INTERNAL_IPS
  22. # https if nginx responce HTTP_X_FORWARDED_PROTO=https
  23. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  24. # Application definition
  25. INSTALLED_APPS = [
  26. 'design_template',
  27. 'jazzmin',
  28. 'django.contrib.admin',
  29. 'django.contrib.auth',
  30. 'django.contrib.contenttypes',
  31. 'django.contrib.sessions',
  32. 'django.contrib.messages',
  33. 'django.contrib.staticfiles',
  34. 'user.apps.UserConfig',
  35. 'sharix_admin.apps.ShariXAdminConfig',
  36. 'tickets.apps.TicketsConfig',
  37. 'dbsynce.apps.DbsyncedConfig',
  38. 'webservice_running.apps.WebserviceRunningConfig',
  39. 'django_tables2',
  40. 'schema_graph',
  41. # "django.contrib.sites",
  42. # "django.contrib.flatpages",
  43. "django_extensions",
  44. 'rest_framework',
  45. "rest_framework_api_key",
  46. 'rest_framework.authtoken',
  47. 'djoser',
  48. 'drf_yasg',
  49. 'django_spaghetti',
  50. 'debug_toolbar',
  51. 'ckeditor',
  52. 'fontawesomefree',
  53. 'landing',
  54. 'captcha',
  55. 'django_filters',
  56. ]
  57. MIDDLEWARE = [
  58. 'django.middleware.security.SecurityMiddleware',
  59. 'django.contrib.sessions.middleware.SessionMiddleware',
  60. 'django.middleware.locale.LocaleMiddleware',
  61. 'django.middleware.common.CommonMiddleware',
  62. 'django.middleware.csrf.CsrfViewMiddleware',
  63. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  64. 'django.contrib.messages.middleware.MessageMiddleware',
  65. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  66. "debug_toolbar.middleware.DebugToolbarMiddleware",
  67. ]
  68. ROOT_URLCONF = "core.urls"
  69. LOGIN_URL = "sharix_admin:auth_login"
  70. LOGIN_REDIRECT_URL = "sharix_admin:main"
  71. LOGOUT_REDIRECT_URL = "sharix_admin:auth_login"
  72. SESSION_EXPIRE_AT_BROWSER_CLOSE = False
  73. SESSION_SECURITY_WARN_AFTER = 5
  74. SESSION_SECURITY_EXPIRE_AFTER = 12
  75. TEMPLATES = [
  76. {
  77. "BACKEND": "django.template.backends.django.DjangoTemplates",
  78. "DIRS": [os.path.join(BASE_DIR, "templates")],
  79. "APP_DIRS": True,
  80. "OPTIONS": {
  81. "context_processors": [
  82. "django.template.context_processors.debug",
  83. "django.template.context_processors.request",
  84. "django.contrib.auth.context_processors.auth",
  85. "django.template.context_processors.i18n",
  86. "django.template.context_processors.media",
  87. "django.template.context_processors.static",
  88. "django.template.context_processors.tz",
  89. "design_template.context_processors.get_name_system",
  90. "django.contrib.messages.context_processors.messages",
  91. ],
  92. },
  93. }
  94. ]
  95. WSGI_APPLICATION = 'core.wsgi.application'
  96. # Database
  97. # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
  98. if sv.DB_NAME:
  99. DATABASES = {
  100. 'default': {
  101. 'ENGINE': 'django.db.backends.postgresql',
  102. 'NAME': sv.DB_NAME,
  103. 'USER': sv.DB_USER,
  104. 'PASSWORD': sv.DB_PASSWORD,
  105. 'HOST': sv.DB_HOST,
  106. 'PORT': sv.DB_PORT,
  107. }
  108. }
  109. else:
  110. DATABASES = {
  111. 'default': {
  112. 'ENGINE': 'django.db.backends.sqlite3',
  113. 'NAME': BASE_DIR / 'db.sqlite3',
  114. }
  115. }
  116. # Password validation
  117. # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
  118. AUTH_PASSWORD_VALIDATORS = [
  119. {
  120. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  121. },
  122. {
  123. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  124. },
  125. {
  126. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  127. },
  128. {
  129. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  130. },
  131. ]
  132. #Password hashgen
  133. PASSWORD_HASHERS = [
  134. 'django.contrib.auth.hashers.Argon2PasswordHasher',
  135. 'django.contrib.auth.hashers.PBKDF2PasswordHasher',
  136. 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
  137. 'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
  138. 'django.contrib.auth.hashers.ScryptPasswordHasher',
  139. ]
  140. # Internationalization
  141. # https://docs.djangoproject.com/en/4.0/topics/i18n/
  142. LANGUAGE_CODE = 'ru'
  143. USE_TZ = True
  144. TIME_ZONE = 'Europe/Moscow'
  145. SITE_ID = 1
  146. # If you set this to False, Django will make some optimizations so as not
  147. # to load the internationalization machinery.
  148. USE_I18N = True
  149. LANGUAGES = [
  150. ('ru', _('Russian')),
  151. ('en', _('English')),
  152. ]
  153. # Static files (CSS, JavaScript, Images)
  154. # https://docs.djangoproject.com/en/4.0/howto/static-files/
  155. STATIC_URL = "/static/"
  156. STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
  157. # Uploaded media
  158. MEDIA_URL = "/media/"
  159. MEDIA_ROOT = os.path.join(BASE_DIR, "media")
  160. # Without this, uploaded files > 4MB end up with perm 0600, unreadable by web server process
  161. FILE_UPLOAD_PERMISSIONS = 0o644
  162. # Override CSS class for the ERROR tag level to match Bootstrap class name
  163. MESSAGE_TAGS = {message_constants.ERROR: "danger"}
  164. # Default primary key field type
  165. # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
  166. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  167. AUTH_USER_MODEL = 'user.ShariXUser'
  168. NAME_SYSTEM = sv.NAME_SYSTEM
  169. ########
  170. #
  171. # Jazzmin
  172. #
  173. ########
  174. JAZZMIN_SETTINGS = {
  175. # title of the window (Will default to current_admin_site.site_title if absent or None)
  176. "site_title": "ShariX Admin",
  177. # Title on the login screen (19 chars max) (defaults to current_admin_site.site_header if absent or None)
  178. "site_header": "ShariX Platform",
  179. # Title on the brand (19 chars max) (defaults to current_admin_site.site_header if absent or None)
  180. "site_brand": "ShariX Platform",
  181. # Logo to use for your site, must be present in static files, used for brand on top left
  182. "site_logo": "sharix_admin/img/logo.png",
  183. # Logo to use for your site, must be present in static files, used for login form logo (defaults to site_logo)
  184. "login_logo": None,
  185. # Logo to use for login form in dark themes (defaults to login_logo)
  186. "login_logo_dark": None,
  187. # CSS classes that are applied to the logo above
  188. "site_logo_classes": "img-circle",
  189. # Relative path to a favicon for your site, will default to site_logo if absent (ideally 32x32 px)
  190. "site_icon": None,
  191. # Welcome text on the login screen
  192. "welcome_sign": "Welcome to the ShariX Admin",
  193. # Copyright on the footer
  194. "copyright": "Acme Library Ltd",
  195. # List of model admins to search from the search bar, search bar omitted if excluded
  196. # If you want to use a single search field you dont need to use a list, you can use a simple string
  197. "search_model": ["sharix_admin.SharixUser"],
  198. # Field name on user model that contains avatar ImageField/URLField/Charfield or a callable that receives the user
  199. "user_avatar": "",
  200. ############
  201. # Top Menu #
  202. ############
  203. # Links to put along the top menu
  204. "topmenu_links": [
  205. # Url that gets reversed (Permissions can be added)
  206. {"name": "Главная", "url": "admin:index", "permissions": ["auth.view_user"]},
  207. # external url that opens in a new window (Permissions can be added)
  208. # {"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
  209. # model admin to link to (Permissions checked against model)
  210. {"model": "sharix_admin.SharixUser"},
  211. # App with dropdown menu to all its models pages (Permissions checked against models)
  212. {"app": "tickets"},
  213. ],
  214. #############
  215. # User Menu #
  216. #############
  217. # Additional links to include in the user menu on the top right ("app" url type is not allowed)
  218. # "usermenu_links": [
  219. # {"name": "Support", "url": "https://github.com/farridav/django-jazzmin/issues", "new_window": True},
  220. # {"model": "sharix_admin.SharixUser"}
  221. # ],
  222. # #############
  223. # # Side Menu #
  224. # #############
  225. # # Whether to display the side menu
  226. # "show_sidebar": True,
  227. # # Whether to aut expand the menu
  228. # "navigation_expanded": True,
  229. # # Hide these apps when generating side menu e.g (auth)
  230. # "hide_apps": [],
  231. # # Hide these models when generating side menu (e.g auth.user)
  232. # "hide_models": [],
  233. # # List of apps (and/or models) to base side menu ordering off of (does not need to contain all apps/models)
  234. # #"order_with_respect_to": ["auth", "books", "books.author", "books.book"],
  235. # # Custom links to append to app groups, keyed on app name
  236. # "custom_links": {
  237. # "tickets": [{
  238. # "name": "Make Messages",
  239. # "url": "make_messages",
  240. # "icon": "fas fa-comments",
  241. # "permissions": ["tickets.view_book"]
  242. # }]
  243. # },
  244. # # Custom icons for side menu apps/models See https://fontawesome.com/icons?d=gallery&m=free&v=5.0.0,5.0.1,5.0.10,5.0.11,5.0.12,5.0.13,5.0.2,5.0.3,5.0.4,5.0.5,5.0.6,5.0.7,5.0.8,5.0.9,5.1.0,5.1.1,5.2.0,5.3.0,5.3.1,5.4.0,5.4.1,5.4.2,5.13.0,5.12.0,5.11.2,5.11.1,5.10.0,5.9.0,5.8.2,5.8.1,5.7.2,5.7.1,5.7.0,5.6.3,5.5.0,5.4.2
  245. # # for the full list of 5.13.0 free icon classes
  246. "icons": {
  247. "auth": "fas fa-users-cog",
  248. "auth.user": "fas fa-user",
  249. "auth.Group": "fas fa-users",
  250. "sharix_admin": "fas fa-users-cog",
  251. "sharix_admin.SharixUser": "fas fa-user",
  252. "tickets.Task": "fas fa-check",
  253. "tickets.TaskList": "fas fa-list",
  254. "tickets.Comment": "fas fa-comment",
  255. "tickets.Attachment": "fas fa-file",
  256. },
  257. # # Icons that are used when one is not manually specified
  258. # # "default_icon_parents": "fas fa-chevron-circle-right",
  259. # # "default_icon_children": "fas fa-circle",
  260. # #################
  261. # # Related Modal #
  262. # #################
  263. # # Use modals instead of popups
  264. # "related_modal_active": False,
  265. # #############
  266. # # UI Tweaks #
  267. # #############
  268. # # Relative paths to custom CSS/JS scripts (must be present in static files)
  269. "custom_css": None,
  270. "custom_js": None,
  271. # Whether to link font from fonts.googleapis.com (use custom_css to supply font otherwise)
  272. "use_google_fonts_cdn": True,
  273. # # Whether to show the UI customizer on the sidebar
  274. "show_ui_builder": True,
  275. ###############
  276. # Change view #
  277. ###############
  278. # Render out the change view as a single form, or in tabs, current options are
  279. # - single
  280. # - horizontal_tabs (default)
  281. # - vertical_tabs
  282. # - collapsible
  283. # - carousel
  284. # "changeform_format": "horizontal_tabs",
  285. # override change forms on a per modeladmin basis
  286. # "changeform_format_overrides": {"sharix_admin.SharixUser": "collapsible", "auth.group": "vertical_tabs"},
  287. # Add a language dropdown into the admin
  288. # "language_chooser": True,
  289. }
  290. JAZZMIN_UI_TWEAKS = {
  291. "navbar_small_text": True,
  292. "footer_small_text": True,
  293. "body_small_text": False,
  294. "brand_small_text": True,
  295. "brand_colour": "navbar-light",
  296. "accent": "accent-navy",
  297. "navbar": "navbar-navy navbar-dark",
  298. "no_navbar_border": False,
  299. "navbar_fixed": False,
  300. "layout_boxed": False,
  301. "footer_fixed": False,
  302. "sidebar_fixed": True,
  303. "sidebar": "sidebar-light-navy",
  304. "sidebar_nav_small_text": False,
  305. "sidebar_disable_expand": False,
  306. "sidebar_nav_child_indent": False,
  307. "sidebar_nav_compact_style": True,
  308. "sidebar_nav_legacy_style": False,
  309. "sidebar_nav_flat_style": False,
  310. "theme": "default",
  311. "dark_mode_theme": None,
  312. "button_classes": {
  313. "primary": "btn-outline-primary",
  314. "secondary": "btn-outline-secondary",
  315. "info": "btn-outline-info",
  316. "warning": "btn-outline-warning",
  317. "danger": "btn-outline-danger",
  318. "success": "btn-outline-success"
  319. },
  320. "actions_sticky_top": False
  321. }
  322. ########
  323. #
  324. # API
  325. #
  326. ########
  327. API_URL = sv.API_URL
  328. REST_FRAMEWORK = {
  329. # Use Django's standard `django.contrib.auth` permissions,
  330. # or allow read-only access for unauthenticated users.
  331. 'DEFAULT_RENDERER_CLASSES': [
  332. 'rest_framework.renderers.JSONRenderer',
  333. 'rest_framework.renderers.BrowsableAPIRenderer',
  334. ],
  335. 'DEFAULT_PERMISSION_CLASSES': [
  336. # 'rest_framework.permissions.AllowAny',
  337. # 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
  338. ],
  339. 'DEFAULT_AUTHENTICATION_CLASSES': (
  340. 'rest_framework.authentication.TokenAuthentication',
  341. 'rest_framework.authentication.BasicAuthentication',
  342. 'rest_framework.authentication.SessionAuthentication',
  343. ),
  344. 'DEFAULT_FILTER_BACKENDS': (
  345. 'django_filters.rest_framework.DjangoFilterBackend',
  346. ),
  347. }
  348. SPAGHETTI_SAUCE = {
  349. 'apps': [
  350. 'auth',
  351. 'sharix_admin',
  352. 'tickets',
  353. 'admin',
  354. # 'flatpages',
  355. 'sessions',
  356. # 'sites',
  357. 'dbsynce'
  358. ],
  359. 'show_fields': False,
  360. 'show_proxy': True,
  361. }
  362. GRAPH_MODELS = {
  363. 'all_applications': True,
  364. 'group_models': True,
  365. }
  366. # Email
  367. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  368. EMAIL_HOST = sv.EMAIL_HOST
  369. EMAIL_PORT = sv.EMAIL_PORT
  370. EMAIL_USE_TLS = sv.EMAIL_USE_TLS
  371. EMAIL_HOST_USER = sv.EMAIL_HOST_USER
  372. EMAIL_HOST_PASSWORD = sv.EMAIL_HOST_PASSWORD
  373. DEFAULT_FROM_EMAIL = sv.DEFAULT_FROM_EMAIL
  374. #LDAP
  375. # Baseline configuration.
  376. AUTH_LDAP_PROTO = "ldap"
  377. AUTH_LDAP_HOST = "ldap.sharix.ru"
  378. AUTH_LDAP_PORT = '389' # must be str
  379. #AUTH_LDAP_GID = "502" # group ID to add signed up users
  380. #AUTH_LDAP_BASE_UID = 1000 # Integer
  381. #AUTH_LDAP_SERVER_URI = LDAP_PROTO+"://"+LDAP_HOST+":"+LDAP_PORT
  382. AUTH_LDAP_SERVER_URI = AUTH_LDAP_PROTO+"://"+AUTH_LDAP_HOST
  383. #If we want to use there - we should create custom ldap login backend - https://django-auth-ldap.readthedocs.io/en/latest/custombehavior.html
  384. #LDAP_LOGIN_ATTEMPT_LIMIT = 100
  385. #LDAP_RESET_TIME = 15 * 60
  386. #AUTH_LDAP_BASE_DN = "dc=ldap,dc=sharix,dc=ru"
  387. AUTH_LDAP_BASE_DN = "dc=ldap,dc=sharix,dc=ru"
  388. AUTH_LDAP_BIND_DN = "cn=admin,dc=ldap,dc=sharix,dc=ru"
  389. AUTH_LDAP_BIND_PASSWORD = "secret"
  390. AUTH_LDAP_USER_SEARCH = LDAPSearch(
  391. "ou=users,dc=ldap,dc=sharix,dc=ru", ldap.SCOPE_SUBTREE, "(telephoneNumber=%(user)s)"
  392. # "ou=users,dc=ldap,dc=sharix,dc=ru", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"
  393. )
  394. # Or:
  395. # AUTH_LDAP_USER_DN_TEMPLATE = 'uid=%(user)s,ou=users,dc=example,dc=com'
  396. # Set up the basic group parameters.
  397. AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
  398. "ou=groups,dc=ldap,dc=sharix,dc=ru",
  399. # "ou=apps,dc=ldap,dc=sharix,dc=ru",
  400. #TODO need to specify only django users
  401. ldap.SCOPE_SUBTREE,
  402. "(objectClass=groupOfNames)",
  403. )
  404. AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn")
  405. # Simple group restrictions
  406. #AUTH_LDAP_REQUIRE_GROUP = "cn=client,ou=groups,dc=ldap,dc=sharix,dc=ru"
  407. #AUTH_LDAP_REQUIRE_GROUP = "cn=django,ou=apps,dc=ldap,dc=sharix,dc=ru"
  408. #AUTH_LDAP_DENY_GROUP = "cn=disabled,ou=django,ou=groups,dc=example,dc=com"
  409. #AUTH_LDAP_DENY_GROUP = "cn=handlers,ou=apps,dc=ldap,dc=sharix,dc=ru"
  410. # TODO - it duplicates local lib for ldap, decide where it's better to be placed.
  411. #Most likely left side - Django, right side - LDAP
  412. # Populate the Django user from the LDAP directory.
  413. AUTH_LDAP_USER_ATTR_MAP = {
  414. "id": "uid",
  415. "password": "userPassword",
  416. "last_name": "sn",
  417. "middle_name": "initials",
  418. "first_name": "givenName",
  419. "email": "mail",
  420. "avatar": "jpegPhoto",
  421. "phone": "telephoneNumber",
  422. "username": "uid",
  423. }
  424. AUTH_LDAP_USER_FLAGS_BY_GROUP = {
  425. "is_active": [
  426. "cn=PLATFORM-ADMIN,ou=groups,dc=ldap,dc=sharix,dc=ru",
  427. "cn=PLATFORM-SUPERVISOR,ou=groups,dc=ldap,dc=sharix,dc=ru",
  428. "cn=PLATFORM-SUPPORT,ou=groups,dc=ldap,dc=sharix,dc=ru",
  429. "cn=PLATFORM-TECHSUPPORT,ou=groups,dc=ldap,dc=sharix,dc=ru",
  430. "cn=METASERVICE-ADMIN,ou=groups,dc=ldap,dc=sharix,dc=ru",
  431. "cn=CLIENT,ou=groups,dc=ldap,dc=sharix,dc=ru",
  432. "cn=django_admin,ou=groups,dc=ldap,dc=sharix,dc=ru",
  433. ],
  434. "is_staff": [
  435. "cn=PLATFORM-TECHSUPPORT,ou=groups,dc=ldap,dc=sharix,dc=ru",
  436. "cn=django_admin,ou=groups,dc=ldap,dc=sharix,dc=ru",
  437. ],
  438. "is_superuser": "cn=django_admin,ou=groups,dc=ldap,dc=sharix,dc=ru",
  439. }
  440. #AUTH_LDAP_REQUIRE_GROUP = (
  441. # LDAPGroupQuery("cn=client,ou=groups,dc=ldap,dc=sharix,dc=ru")
  442. # | LDAPGroupQuery("cn=platform_admin,ou=groups,dc=ldap,dc=sharix,dc=ru")
  443. #) & ~LDAPGroupQuery("cn=metaservice_admin,ou=groups,dc=ldap,dc=sharix,dc=ru")
  444. # This is the default, but I like to be explicit.
  445. AUTH_LDAP_ALWAYS_UPDATE_USER = True
  446. # Use LDAP group membership to calculate group permissions.
  447. AUTH_LDAP_FIND_GROUP_PERMS = True
  448. # Cache distinguished names and group memberships for an hour to minimize
  449. # LDAP traffic.
  450. AUTH_LDAP_CACHE_TIMEOUT = 3600
  451. AUTH_LDAP_MIRROR_GROUPS = True
  452. # Keep ModelBackend around for per-user permissions and maybe a local
  453. # superuser.
  454. AUTHENTICATION_BACKENDS = (
  455. "django_auth_ldap.backend.LDAPBackend",
  456. # "django.contrib.auth.backends.ModelBackend",
  457. )
  458. LOGGING = {
  459. 'version': 1,
  460. 'disable_existing_loggers': False,
  461. 'handlers': {
  462. 'file': {
  463. 'level': 'DEBUG',
  464. 'class': 'logging.FileHandler',
  465. 'filename': '/var/log/django-ldap.log',
  466. },
  467. },
  468. 'loggers': {
  469. 'django_auth_ldap': {
  470. 'handlers': ['file'],
  471. 'level': 'DEBUG',
  472. 'propagate': True,
  473. },
  474. },
  475. }