text: """
  Django settings for training project.
  
  Generated by 'django-admin startproject' using Django 1.11.1.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/1.11/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/1.11/ref/settings/
  """
  
  import os
  import django_heroku
  
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = bool(int(os.environ.get('DEBUG'))) if os.environ.get('DEBUG') else True
  
  # SECURITY WARNING: keep the secret key used in production secret!
  
  if not DEBUG:
      SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')
  else:
      SECRET_KEY = 'wi$7j2y_g(x_3et3wl*d0kawd1ud3zbncs7^4s(-!!k+20-lsi'
  
  
  ALLOWED_HOSTS = ['ts-training.herokuapp.com', '127.0.0.1', 'localhost']
  
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.9/howto/static-files/
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  STATIC_URL = '/static/'
  
  # Extra places for collectstatic to find static files.
  STATICFILES_DIRS = (
      os.path.join(BASE_DIR, 'static'),
  )
  # Application definition
  
  INSTALLED_APPS = [
      # Training
      'ts_training.apps.NtTrainingConfig',
      # Django Default
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  
      'debug_toolbar',
      'widget_tweaks',
  ]
  
  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',
  
      'debug_toolbar.middleware.DebugToolbarMiddleware',
  ]
  
  ROOT_URLCONF = 'training.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 = 'training.wsgi.application'
  
  # Database
  # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  if not DEBUG:
      import dj_database_url
      DATABASES['default'] = dj_database_url.config()
  
  
  # Password validation
  # https://docs.djangoproject.com/en/1.11/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/1.11/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  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'
          }
      },
      'filters': {
          'require_debug_false': {
              '()': 'django.utils.log.RequireDebugFalse'
          }
      },
      'handlers': {
          'console': {
              'level': 'DEBUG',
              'class': 'logging.StreamHandler',
              'formatter': 'verbose'
          },
          'mail_admins': {
              'level': 'ERROR',
              'filters': ['require_debug_false'],
              'class': 'django.utils.log.AdminEmailHandler'
          }
      },
      'loggers': {
          'django.request': {
              'handlers': ['mail_admins'],
              'level': 'ERROR',
              'propagate': True,
          },
          # Might as well log any errors anywhere else in Django
          'django': {
              'handlers': ['console'],
              'level': 'ERROR',
              'propagate': False,
          },
      }
  }
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.11/howto/static-files/
  
  STATIC_URL = '/static/'
  STATIC_ROOT = os.path.join(BASE_DIR, "static/")
  # Auth Settings
  LOGIN_URL = 'ts_training:ntLogin'
  LOGIN_REDIRECT_URL = 'ts_training:ntHome'
  LOGOUT_REDIRECT_URL = 'ts_training:ntHome'
  #Custom user Model
  AUTH_USER_MODEL = 'ts_training.Person'
  
  # Debug toolbar
  # INTERNAL_IPS = ('127.0.0.1')
  # DEBUG_TOOLBAR_PATCH_SETTINGS = True
  
  django_heroku.settings(locals())
  