text: """
  Django settings for ch_app_server project.
  
  Generated by 'django-admin startproject' using Django 2.2.1.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/2.2/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/2.2/ref/settings/
  """
  
  import os
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = '0rr10b8wg=_0w6oci=nk=s!4(_*@f%4&dekbt@c@x(4o&vn-rd'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = False
  
  ALLOWED_HOSTS = os.getenv(
      'ALLOWED_HOSTS', 'localhost,evangelion.stmary-rehab.com').split(',')
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'jet',
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'rest_framework',
      'smart_selects',
      'django_filters',
      'ckeditor',
      # 'ckeditor_uploader',
      'explorer',
  
      'bible',
      'challenges',
      'users',
      'topics',
      'posts',
  ]
  
  AUTH_USER_MODEL = 'users.AdminUser'
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'ch_app_server.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'ch_app_server.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': os.environ.get('POSTGRES_DB', 'stmaryrehab'),
          'USER': os.environ.get('POSTGRES_USER', 'stmaryrehab'),
          'PASSWORD': os.environ.get('POSTGRES_PASSWORD', 'stmaryrehab'),
          'HOST': 'db',
          'PORT': '5432'
      }
  }
  
  REST_FRAMEWORK = {
      'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',),
  }
  
  # Password validation
  # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/2.2/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'Africa/Cairo'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  REST_FRAMEWORK = {
      'DEFAULT_RENDERER_CLASSES': [
          'rest_framework.renderers.JSONRenderer',
      ]
  }
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/2.2/howto/static-files/
  
  STATIC_URL = '/static/'
  STATIC_ROOT = '/static'
  MEDIA_URL = '/media/'
  MEDIA_ROOT = '/media'
  
  USE_DJANGO_JQUERY = True
  
  JET_DEFAULT_THEME = 'default'
  JET_SIDE_MENU_COMPACT = True
  JET_CHANGE_FORM_SIBLING_LINKS = False
  
  CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/'
  CKEDITOR_UPLOAD_PATH = ''
  
  CKEDITOR_CONFIGS = {
      'default': {
          # 'skin': 'moono',
          'toolbar': 'Custom',
          'toolbar_Custom': [
              ['Format', 'Font', 'FontSize', 'TextColor', 'BGColor'],
              ['Bold', 'Italic', 'Underline', 'Strike'],
              ['NumberedList', 'BulletedList',  'Outdent', 'Indent', 'JustifyLeft',
                  'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'BidiLtr', 'BidiRtl'],
              # ['Link', 'Unlink', 'Image',],
              ['Table', 'HorizontalRule', 'Smiley', 'SpecialChar'],
              ['Undo', 'Redo']
          ],
          'extraPlugins': 'uploadimage'
      }
  }
  # CKEDITOR_IMAGE_BACKEND = 'pillow'
  
  
  EXPLORER_CONNECTIONS = {'Default': 'default'}
  EXPLORER_DEFAULT_CONNECTION = 'default'
  
  
  def EXPLORER_PERMISSION_VIEW(u): return u.is_staff and u.groups.filter(
      name="analytics").exists()
  
  
  def EXPLORER_PERMISSION_CHANGE(u): return u.is_staff and u.groups.filter(
      name="analytics").exists()
  
  
  EXPLORER_SQL_BLACKLIST = (
      "ALTER",
      "RENAME ",
      "DROP",
      "TRUNCATE",
      "INSERT INTO",
      "UPDATE",
      "REPLACE",
      "DELETE",
      "ALTER",
      "CREATE TABLE",
      "SCHEMA",
      "GRANT",
      "OWNER TO",
      "CREATED",
      "UPDATED",
      "DELETED",
      "REGEXP_REPLAC"
  )
  EXPLORER_SQL_WHITELIST = tuple()
  EXPLORER_SCHEMA_INCLUDE_TABLE_PREFIXES = (
      "posts",
      "users",
      "challenges"
  )
  