text: """
  Django settings for gettingstarted project.
  
  Generated by 'django-admin startproject' using Django 2.0.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/2.0/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/2.0/ref/settings/
  """
  
  import os
  import django_heroku
  from pathlib import Path
  import environ
  
  import socket
  
  env = environ.Env()
  # reading .env file
  env.read_env()
  
  INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
  hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
  INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
  
  SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent
  # civictechindexadmin/
  APPS_DIR = ROOT_DIR / "civictechindexadmin"
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = "CHANGE_ME!!!! (P.S. the SECRET_KEY environment variable will be used, if set, instead)."
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  
  # Application definition
  
  DJANGO_APPS = [
      "django.contrib.auth",
      "django.contrib.contenttypes",
      "django.contrib.sessions",
      "django.contrib.sites",
      "django.contrib.messages",
      "django.contrib.staticfiles",
      "django.contrib.postgres",
      # "django.contrib.humanize", # Handy template tags
      "django.contrib.admin",
      "django.forms",
      "corsheaders",
  ]
  THIRD_PARTY_APPS = [
      "crispy_forms",
      "allauth",
      "allauth.account",
      "allauth.socialaccount",
      "rest_framework",
      "rest_framework.authtoken",
      "drf_yasg",
      "django_extensions",
      "treebeard",
      "debug_toolbar",
  ]
  
  LOCAL_APPS = [
      "civictechindexadmin.users.apps.UsersConfig",
      "civictechindexadmin.data.apps.DataConfig",
  ]
  
  INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
  
  
  # MIGRATIONS
  # ------------------------------------------------------------------------------
  # https://docs.djangoproject.com/en/dev/ref/settings/#migration-modules
  MIGRATION_MODULES = {"sites": "civictechindexadmin.contrib.sites.migrations"}
  
  # AUTHENTICATION
  # ------------------------------------------------------------------------------
  # https://docs.djangoproject.com/en/dev/ref/settings/#authentication-backends
  AUTHENTICATION_BACKENDS = [
      "django.contrib.auth.backends.ModelBackend",
      "allauth.account.auth_backends.AuthenticationBackend",
  ]
  # https://docs.djangoproject.com/en/dev/ref/settings/#auth-user-model
  AUTH_USER_MODEL = "users.User"
  # https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url
  LOGIN_REDIRECT_URL = "users:redirect"
  # https://docs.djangoproject.com/en/dev/ref/settings/#login-url
  LOGIN_URL = "account_login"
  SITE_ID = 1
  
  MIDDLEWARE = [
      "debug_toolbar.middleware.DebugToolbarMiddleware",
      "corsheaders.middleware.CorsMiddleware",
      "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 = "config.urls"
  
  # DJANGO CORS HEADER
  CORS_ORIGIN_ALLOW_ALL = True
  
  # MEDIA
  # ------------------------------------------------------------------------------
  # https://docs.djangoproject.com/en/dev/ref/settings/#media-root
  MEDIA_ROOT = str(APPS_DIR / "media")
  # https://docs.djangoproject.com/en/dev/ref/settings/#media-url
  MEDIA_URL = "/media/"
  
  
  TEMPLATES = [
      {
          # https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-TEMPLATES-BACKEND
          "BACKEND": "django.template.backends.django.DjangoTemplates",
          # https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
          "DIRS": [str(APPS_DIR / "templates")],
          "OPTIONS": {
              # https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
              # https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types
              "loaders": [
                  "django.template.loaders.filesystem.Loader",
                  "django.template.loaders.app_directories.Loader",
              ],
              # https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
              "context_processors": [
                  "django.template.context_processors.debug",
                  "django.template.context_processors.request",
                  "django.contrib.auth.context_processors.auth",
                  "django.template.context_processors.i18n",
                  "django.template.context_processors.media",
                  "django.template.context_processors.static",
                  "django.template.context_processors.tz",
                  "django.contrib.messages.context_processors.messages",
                  "civictechindexadmin.utils.context_processors.settings_context",
              ],
          },
      }
  ]
  
  WSGI_APPLICATION = "config.wsgi.application"
  
  
  # Database
  # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': env('POSTGRES_DATABASE', default='postgres'),
          'USER': env('POSTGRES_USER', default='postgres'),
          'PASSWORD': env('POSTGRES_PASSWORD', default=''),
          'HOST': env('POSTGRES_HOST', default='localhost'),
          'PORT': env('POSTGRES_PORT', default=5432),
      }
  }
  # Password validation
  # https://docs.djangoproject.com/en/2.0/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.0/topics/i18n/
  
  LANGUAGE_CODE = "en-us"
  
  TIME_ZONE = "UTC"
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # ADMIN
  # ------------------------------------------------------------------------------
  # Django Admin URL.
  ADMIN_URL = "admin/"
  # https://docs.djangoproject.com/en/dev/ref/settings/#admins
  ADMINS = [("""Cynthia Kiser""", "cynthiakiser@gmail.com")]
  # https://docs.djangoproject.com/en/dev/ref/settings/#managers
  MANAGERS = ADMINS
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/2.0/howto/static-files/
  
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  STATIC_URL = "/static/"
  
  django_heroku.settings(locals())
  