text: """
  Django settings for fyle_backup_app project.
  
  Generated by 'django-admin startproject' using Django 3.0.4.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/3.0/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/3.0/ref/settings/
  """
  
  import os
  
  from django.contrib.messages import constants as messages
  # 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/3.0/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = os.environ.get('SECRET_KEY')
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True if os.environ.get('DEBUG') == 'True' else False
  
  ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS').split(',')
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'django.contrib.sites',
      'allauth',
      'allauth.account',
      'allauth.socialaccount',
      'fyle_allauth',
      'apps.user',
      'apps.fyle_connect',
      'apps.backups',
      'apps.data_fetcher',
      'tempus_dominus'
  ]
  
  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 = 'fyle_backup_app.urls'
  
  TEMPLATE_LOADERS = (
      'django.template.loaders.app_directories.load_template_source',
      'django.template.loaders.filesystem.load_template_source',
  )
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates'),],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'apps.user.context_processors.user_data',
                  'apps.fyle_connect.context_processors.org_name',
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  # django-allauth settings
  SITE_ID = 1
  LOGIN_URL = '/'
  LOGIN_REDIRECT_URL = '/main/home/'
  LOGOUT_REDIRECT_URL = '/'
  
  AUTHENTICATION_BACKENDS = (
      'django.contrib.auth.backends.ModelBackend',
      'allauth.account.auth_backends.AuthenticationBackend',
  )
  
  # Set custom user model
  AUTH_USER_MODEL = 'user.UserProfile'
  # For custom user model that has email as the user identifying field
  ACCOUNT_USER_MODEL_USERNAME_FIELD = None
  ACCOUNT_EMAIL_REQUIRED = True
  ACCOUNT_USERNAME_REQUIRED = False
  ACCOUNT_AUTHENTICATION_METHOD = 'email'
  ACCOUNT_EMAIL_VERIFICATION = 'none'
  SOCIALACCOUNT_AUTO_SIGNUP = True
  
  WSGI_APPLICATION = 'fyle_backup_app.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': os.environ.get('DB_NAME'),
          'USER': os.environ.get('DB_USER'),
          'PASSWORD': os.environ.get('DB_PASSWORD'),
          'HOST': os.environ.get('DB_HOST'),
          'PORT': os.environ.get('DB_PORT'),
      }
  }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/3.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/3.0/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/3.0/howto/static-files/
  
  STATIC_URL = '/static/'
  STATICFILES_DIRS = [
      os.path.join(BASE_DIR, "static"),
  ]
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  
  MESSAGE_TAGS = {
      messages.SUCCESS: 'alert-success',
      messages.WARNING: 'alert-warning',
      messages.ERROR: 'alert-danger',
  }
  
  # Fyle OAuth2.0
  BASE_URL = os.environ.get('BASE_URL')
  FYLE_BASE_URL = os.environ.get('FYLE_BASE_URL')
  CLIENT_ID = os.environ.get('CLIENT_ID')
  CLIENT_SECRET = os.environ.get('CLIENT_SECRET')
  AUTHORIZE_URI = os.environ.get('AUTHORIZE_URI').format(FYLE_BASE_URL)
  REDIRECT_URI = os.environ.get('REDIRECT_URI')
  TOKEN_URI = os.environ.get('TOKEN_URI').format(FYLE_BASE_URL)
  
  DOWNLOAD_PATH = os.environ.get('DOWNLOAD_PATH')
  CLOUD_STORAGE_PROVIDER = os.environ.get('CLOUD_STORAGE_PROVIDER')
  
  # AWS details
  AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID')
  AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY')
  S3_BUCKET_NAME = os.environ.get('S3_BUCKET_NAME')
  S3_REGION_NAME = os.environ.get('S3_REGION_NAME')
  PRESIGNED_URL_EXPIRY = os.environ.get('PRESIGNED_URL_EXPIRY')
  
  FYLE_JOBS_URL = os.environ.get('FYLE_JOBS_URL')
  FYLE_JOBS_CALLBACK_URL = os.environ.get('FYLE_JOBS_CALLBACK_URL')
  
  # Email settings
  SENDGRID_API_KEY = os.environ.get('SENDGRID_API_KEY')
  SENDER_EMAIL_ID = os.environ.get('SENDER_EMAIL_ID')
  
  # Testing creds
  TEST_REFRESH_TOKEN = os.environ.get('TEST_REFRESH_TOKEN')
  TEST_FYLE_ORG_ID = os.environ.get('TEST_FYLE_ORG_ID')
  
  BACKUPS_LIMIT = 5
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'formatters': {
          'verbose': {
              'format' : "[%(asctime)s] %(process)d %(levelname)s \
                           [%(module)s %(name)s %(funcName)s():%(lineno)s]: %(message)s",
              'datefmt' : "%d/%b/%Y %H:%M:%S"
          },
          'simple': {
              'format': '%(process)d%(levelname)s %(message)s'
          },
      },
      'handlers': {
          'file': {
              'level': 'INFO',
              'class': 'logging.FileHandler',
              'filename': '/var/log/fyle/fyle_backup.log',
              'formatter': 'verbose',
          },
          'null': {
              'class': 'logging.NullHandler',
          },
      },
      'loggers': {
          'django': {
              'handlers': ['null'],
              'propagate': True,
              'level': 'INFO',
          },
          'app': {
              'handlers': ['file'],
              'level': 'INFO',
          }
      }
  }
  