text: """
  Django settings for urlshortener project.
  
  Generated by 'django-admin startproject' using Django 3.2.8.
  
  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/
  """
  
  from pathlib import Path
  import django_heroku
  import dj_database_url
  from dotenv import load_dotenv
  import os
  
  import logging
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'handlers': {
          'console': {
              'class': 'logging.StreamHandler',
          },
      },
      'loggers': {
          'django': {
              'handlers': ['console'],
              'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
          },
      },
  }
  
  load_dotenv()
  
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
  BASE_DIR = Path(__file__).resolve().parent.parent
  
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'django-insecure-tw^+-mc%8ue+)vunh!_w1y%z&!bdw@u0-#%0m2(i&hs#n1v^x2'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  if DEBUG:
      ALLOWED_HOSTS = ['localhost', '127.0.0.1']
  else:
      ALLOWED_HOSTS = ['https://shorten-it-api.herokuapp.com/']
  
  
  CORS_ORIGIN_ALLOW_ALL = True
  
  # Application definition
  
  INSTALLED_APPS = [
      'shortenit.apps.ShortenitConfig',
      'rest_framework',
      'corsheaders',
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  ]
  
  MIDDLEWARE = [
      'corsheaders.middleware.CorsMiddleware',
      'whitenoise.middleware.WhiteNoiseMiddleware',
      '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 = 'urlshortener.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',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'urlshortener.wsgi.application'
  
  
  # Database
  
  # DATABASES = {
  #     'default': {
  #         'ENGINE': 'django.db.backends.sqlite3',
  #         'NAME': BASE_DIR / 'db.sqlite3',
  #     }
  # }
  
  DATABASES = {}
  DATABASES['default'] = dj_database_url.config(conn_max_age=600)
  
  
  
  # Password validation
  
  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
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  
  STATIC_URL = '/static/'
  
  SHORTCODE_MAX = 15
  SHORTCODE_MIN = 6
  
  # Default primary key field type
  
  DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  
  STATICFILES_DIRS = (
  os.path.join(BASE_DIR, 'static'),
  )
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  MEDIA_URL = '/media/'
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  X_FRAME_OPTIONS = 'SAMEORIGIN'
  
  django_heroku.settings(locals())
  options = DATABASES['default'].get('OPTIONS', {})
  options.pop('sslmode', None)
  