text: """
  Django settings for docmanageapp 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
  
  # 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['DJANGOSECRET']
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  #ALLOWED_HOSTS = ['*']
  ALLOWED_HOSTS = [os.environ['WEBSITESITENAME'] + '.azurewebsites.net', '127.0.0.1', 'localhost'] if 'WEBSITESITENAME' in os.environ else []
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'initial',
      'menu',
      'upload',
      'download',
      'crispy_forms',
      'storages',
  ]
  
  # Crispy Forms
  CRISPY_TEMPLATE_PACK = 'bootstrap4'
  
  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',
      #'whitenoise.middleware.WhiteNoiseMiddleware',
  ]
  
  ROOT_URLCONF = 'docmanageapp.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          '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 = 'docmanageapp.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
  
  DATABASES = {
      'default': {
          #'ENGINE': 'sql_server.pyodbc',
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': os.environ['DBNAME'],
          'USER': os.environ['DBUSER'],
          'PASSWORD': os.environ['DBPASS'],
          'HOST': os.environ['DBHOST'],
          #'PORT': '1433',
          #'OPTIONS': {
          #     'driver': 'ODBC Driver 17 for SQL Server',
          # }
      }
  }
  
  
  # 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 = 'America/Sao_Paulo'
  
  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/'
  #STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  #STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  
  # Login and logout
  
  LOGIN_URL = '/login'
  #LOGIN_REDIRECT_URL = 
  #LOGOUT_REDIRECT_URL = 
  #PASSWORD_RESET_TIMEOUT_DAYS = 3
  
  
  # Upload, files and data
  
  #MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  #MEDIA_URL = '/media/'
  
  DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440 # (2.5 MB)
  FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 # (2.5 MB)
  
  #DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
  #FILE_UPLOAD_TEMP_DIR = None
  #FILE_UPLOAD_HANDLERS = [
  #   'django.core.files.uploadhandler.MemoryFileUploadHandler',
  #   'django.core.files.uploadhandler.TemporaryFileUploadHandler',
  #]
  
  # Number format
  
  DECIMAL_SEPARATOR = ','
  THOUSAND_SEPARATOR = '.'
  USE_THOUSAND_SEPARATOR = False
  
  # Azure Storage Settings
  DEFAULT_FILE_STORAGE = 'docmanageapp.custom_azure.AzureMediaStorage'
  STATICFILES_STORAGE = 'docmanageapp.custom_azure.AzureStaticStorage'
  
  STATIC_LOCATION = "static"
  MEDIA_LOCATION = "media"
  
  AZURE_ACCOUNT_NAME = os.environ['AZURESTORAGEACCOUNT']
  AZURE_CUSTOM_DOMAIN = f'{AZURE_ACCOUNT_NAME}.blob.core.windows.net'
  STATIC_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{STATIC_LOCATION}/'
  MEDIA_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{MEDIA_LOCATION}/'
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'formatters': {
          'verbose': {
              'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
              'datefmt' : "%d/%b/%Y %H:%M:%S"
          },
          'simple': {
              'format': '%(levelname)s %(message)s'
          },
      },
      'handlers': {
          'file': {
              'level': 'DEBUG',
              'class': 'logging.FileHandler',
              'filename': 'mysite.log',
              'formatter': 'verbose'
          },
      },
      'loggers': {
          'django': {
              'handlers':['file'],
              'propagate': True,
              'level':'DEBUG',
          },
          'MYAPP': {
              'handlers': ['file'],
              'level': 'DEBUG',
          },
      }
  }