text: """
  Django settings for web_proj project.
  
  Generated by 'django-admin startproject' using Django 2.1.1.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/2.1/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/2.1/ref/settings/
  """
  
  import os
  
  # with open('/etc/config.json') as config_file:
  #     config = json.load(config.file)
  
  # 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/2.1/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'a!z6n0p)v+da1nwhxx5#l_tuaikcf#8(1b$qk)vmdtr19&_*h&'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '').split(',')
  print(ALLOWED_HOSTS)
  assert all(ALLOWED_HOSTS)
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'input.apps.InputConfig',
      'users.apps.UsersConfig',
      'crispy_forms',
  
      ## pre-installed
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  ]
  
  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 = 'web_proj.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 = 'web_proj.wsgi.application'
  
  
  APP_MYSQL_UNIX_SOCKET = os.getenv('APP_MYSQL_UNIX_SOCKET')
  APP_MYSQL_DB = os.getenv('APP_MYSQL_DB')
  APP_MYSQL_USERNAME = os.getenv('APP_MYSQL_USERNAME')
  APP_MYSQL_PASSWORD = os.getenv('APP_MYSQL_PASSWORD')
  APP_MYSQL_HOST = os.getenv('APP_MYSQL_HOST')
  APP_MYSQL_PORT = os.getenv('APP_MYSQL_PORT')
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'CONN_MAX_AGE': 600,
          'HOST': APP_MYSQL_HOST,
          'PORT': APP_MYSQL_PORT,
          'NAME': APP_MYSQL_DB,
          'USER': APP_MYSQL_USERNAME,
          'PASSWORD': APP_MYSQL_PASSWORD,
          'OPTIONS': {
              'sql_mode': 'TRADITIONAL',
              'charset': 'utf8mb4',
              'init_command': 'SET '
                              'character_set_client=utf8mb4,'
                              'character_set_connection=utf8mb4,'
                              'character_set_database=utf8mb4,'
                              'character_set_results=utf8mb4,'
                              'character_set_server=utf8mb4,'
                              'collation_connection=utf8mb4_general_ci,'
                              'collation_database=utf8mb4_general_ci,'
                              'collation_server=utf8mb4_general_ci'
          },
      }
  }
  
  if APP_MYSQL_UNIX_SOCKET:
      DATABASES['default'].pop('HOST')
      DATABASES['default'].pop('PORT')
      DATABASES['default']['OPTIONS']['unix_socket'] = APP_MYSQL_UNIX_SOCKET
  
  
  # Password validation
  # https://docs.djangoproject.com/en/2.1/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.1/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'Asia/Singapore'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/2.1/howto/static-files/
  
  STATIC_URL = '/static/'
  STATIC_ROOT = os.getenv('STATIC_ROOT')
  
  CRISPY_TEMPLATE_PACK = 'bootstrap4'
  
  LOGIN_REDIRECT_URL = 'input:dashboard'
  