text: """
  Django settings for pyfiddleproj project.
  
  Generated by 'django-admin startproject' using Django 1.9.5.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/1.9/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/1.9/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/1.9/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = os.getenv("DJANGO_SECRET")
  
  # SECURITY WARNING: don't run with debug turned on in production!
  ENVIRONMENT = os.getenv("PYFIDDLE_ENV")
  if ENVIRONMENT == "dev":
      DEBUG = True
  else:
      DEBUG = False
  
  ALLOWED_HOSTS = ['*']
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'social_django',
      'pyfiddleweb',
      'django_extensions',
      "compressor",
  ]
  if ENVIRONMENT != "dev":
      INSTALLED_APPS += ["storages"]
  
  MIDDLEWARE_CLASSES = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'pyfiddleproj.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',
                  'social_django.context_processors.backends',
                  'social_django.context_processors.login_redirect',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'pyfiddleproj.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  
  #  DATABASES = {
  #      'default': {
  #          'ENGINE': 'django.db.backends.sqlite3',
  #          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  #      }
  #  }
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': os.getenv("PYFIDDLE_DB_SCHEMA"),
          'USER': os.getenv("PYFIDDLE_DB_USER"),
          'PASSWORD': os.getenv("PYFIDDLE_DB_PASSWORD"),
          'HOST': os.getenv("PYFIDDLE_DB_HOST"),
          'PORT': '3306',
          }
  }
  
  # Password validation
  # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
  
  AUTHENTICATION_BACKENDS = [
      'social_core.backends.google.GoogleOAuth2',
      'social_core.backends.github.GithubOAuth2',
      'django.contrib.auth.backends.ModelBackend',
  ]
  
  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.9/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.9/howto/static-files/
  
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
      'compressor.finders.CompressorFinder',
  )
  
  STATIC_URL = os.getenv("STATIC_URL")
  STATIC_ROOT = os.getenv("STATIC_ROOT")
  
  COMPRESS_URL = "https://zappa-rhv3u5qby.s3.amazonaws.com/"
  COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
  
  if ENVIRONMENT != "dev":
      AWS_ACCESS_KEY_ID = os.getenv("PYFIDDLE_S3_KEY")
      AWS_SECRET_ACCESS_KEY = os.getenv("PYFIDDLE_S3_SECRET")
      AWS_STORAGE_BUCKET_NAME = 'zappa-rhv3u5qby'
      AWS_S3_CUSTOM_DOMAIN = 'zappa-rhv3u5qby.s3.amazonaws.com'
      STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
      AWS_HEADERS = {
          'Expires': 'Thu, 15 Apr 2010 20:00:00 GMT',
          'Cache-Control': 'max-age=86400',
      }
      AWS_S3_OBJECT_PARAMETERS = {
          'CacheControl': 'max-age=86400',
      }
  
  SOCIAL_AUTH_PIPELINE = (
      'social.pipeline.social_auth.social_details',
      'social.pipeline.social_auth.social_uid',
      'social.pipeline.social_auth.auth_allowed',
      'social.pipeline.social_auth.social_user',
      'social.pipeline.user.create_user',
      'social.pipeline.social_auth.associate_user',
      'social.pipeline.social_auth.load_extra_data',
      'social.pipeline.user.user_details',
  )
  
  
  SOCIAL_AUTH_URL_NAMESPACE = 'social'
  SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/'
  SOCIAL_AUTH_LOGIN_URL = '/login/'
  LOGIN_URL = '/login/'
  
  SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = os.getenv("GOOGLE_AUTH_KEY")
  SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = os.getenv("GOOGLE_AUTH_SECRET")
  SOCIAL_AUTH_GITHUB_KEY = os.getenv("GITHUB_AUTH_KEY")
  SOCIAL_AUTH_GITHUB_SECRET = os.getenv("GITHUB_AUTH_SECRET")
  
  
  SOCIAL_AUTH_GITHUB_SCOPE = [
      'user:email',
  ]
  