text: """
  Django settings for officeslotbooking project.
  
  Generated by 'django-admin startproject' using Django 3.2.7.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/3.2/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/3.2/ref/settings/
  """
  
  import os
  import dj_database_url
  from pathlib import Path
  
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
  BASE_DIR = Path(__file__).resolve().parent.parent
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = os.getenv('SECRET_KEY', 'django-insecure-3zbnivcn^v2jzlvisl2@sa=3f*!o2((q9-z*q!@mwwmk_@3lq=')
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = os.getenv('DJANGO_DEBUG', '') != 'False'
  
  ALLOWED_HOSTS = [os.getenv('DJANGO_HOST', '127.0.0.1')]
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'mainapp.apps.MainappConfig',
      'rest_framework',
      'anymail',
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'whitenoise.middleware.WhiteNoiseMiddleware',
      '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 = 'officeslotbooking.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          '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 = 'officeslotbooking.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql',
          'NAME': os.getenv('DATABASE_NAME', 'officeslotbooking-dev'),
          'USER': os.getenv('DATABASE_USER', 'postgres'),
          'PASSWORD': os.getenv('DATABASE_PASSWORD', ''),
          'HOST': os.getenv('DATABASE_HOST', '127.0.0.1'),
          'PORT': os.getenv('DATABASE_PORT', '5432'),
      }
  }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/3.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/3.2/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Default primary key field type
  # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
  
  DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/3.2/howto/static-files/
  
  STATIC_URL = '/static/'
  
  STATIC_ROOT = BASE_DIR / 'staticfiles'
  STATICFILES_DIRS = [
     BASE_DIR / 'static_build'
  ]
  STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  
  
  prod_db  =  dj_database_url.config(conn_max_age=500)
  DATABASES['default'].update(prod_db)
  
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'formatters': {
          'verbose': {
              'format': ('%(asctime)s [%(process)d] [%(levelname)s] ' +
                         'pathname=%(pathname)s lineno=%(lineno)s ' +
                         'funcname=%(funcName)s %(message)s'),
              'datefmt': '%Y-%m-%d %H:%M:%S'
          },
          'simple': {
              'format': '%(levelname)s %(message)s'
          }
      },
      'handlers': {
          'null': {
              'level': 'DEBUG',
              'class': 'logging.NullHandler',
          },
          'console': {
              'level': 'DEBUG',
              'class': 'logging.StreamHandler',
              'formatter': 'verbose'
          }
      },
      'loggers': {
          'testlogger': {
              'handlers': ['console'],
              'level': 'INFO',
          }
      }
  }
  
  DEBUG_PROPAGATE_EXCEPTIONS = True
  COMPRESS_ENABLED = os.getenv('COMPRESS_ENABLED', False)
  
  
  REST_FRAMEWORK = {
      # Use Django's standard `django.contrib.auth` permissions,
      # or allow read-only access for unauthenticated users.
      # 'DEFAULT_PERMISSION_CLASSES': [
      #     'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
      # ],
      'DEFAULT_PERMISSION_CLASSES': [
              'rest_framework.permissions.IsAuthenticated',
          ],
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.SessionAuthentication',
          'rest_framework.authentication.BasicAuthentication',  # if this at top, cannot log out web
          'rest_framework.authentication.TokenAuthentication',
      ),
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
      'PAGE_SIZE': 10
  }
  
  # redirect after login success
  LOGIN_REDIRECT_URL = '/'
  
  # mailgun email server
  EMAIL_BACKEND = "anymail.backends.mailjet.EmailBackend"
  ANYMAIL = {
      "MAILJET_API_KEY": os.getenv('EMAIL_HOST_USER', ''),
      "MAILJET_SECRET_KEY": os.getenv('EMAIL_HOST_PASSWORD', ''),
      # disable AnymailRecipientsRefused exceptions on invalid or rejected recipients
      "IGNORE_RECIPIENT_STATUS": True,
  }
  MAILJET_API_URL = "https://api.mailjet.com/v3.1/"
  DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL', '')
  