text: """
  Django settings for app project.
  
  Generated by 'django-admin startproject' using Django 2.1.15.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/2.1/ref/settings/
  """
  
  import os
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  from typing import List
  
  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 = os.environ.get(
      "DJANGO_SECRET_KEY", "ngwbul!66x_+w-fu5r6_0ngb6t=zkk&zfc(0p+9to9eo6sh$xi"
  )
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = os.environ.get("DEBUG", True)
  
  ALLOWED_HOSTS: List[str] = [
      "app.so.spb.ru",
      "localhost",
      "127.0.0.1",
      "192.168.0.137",
      "f435-188-243-182-111.ngrok.io",
      "api.dev.matyagin.ru",
  ]
  
  # Application definition
  
  INSTALLED_APPS = [
      "django.contrib.admin",
      "django.contrib.auth",
      "django.contrib.contenttypes",
      "django.contrib.sessions",
      "django.contrib.messages",
      "django.contrib.humanize",
      "django.contrib.staticfiles",
      "rest_framework",
      "reversion",  # https://github.com/etianen/django-reversion
      "reversion_compare",  # https://github.com/jedie/django-reversion-compare
      "rest_framework_swagger",
      "django_fsm",
      "fsm_admin",
      "django_fsm_log",
      "drf_yasg",
      "django_admin_listfilter_dropdown",
      "core",
      "user",
      "so",
      "event",
      "voting",
      "corsheaders",
      "channels",
      "django_select2",
      "report",
      "shtab",
      "area",
      "apply",
  ]
  
  MIDDLEWARE = [
      "django.middleware.security.SecurityMiddleware",
      "django.contrib.sessions.middleware.SessionMiddleware",
      "corsheaders.middleware.CorsMiddleware",
      "django.middleware.common.CommonMiddleware",
      "django.middleware.csrf.CsrfViewMiddleware",
      "django.contrib.auth.middleware.AuthenticationMiddleware",
      "django.contrib.messages.middleware.MessageMiddleware",
      "django.middleware.clickjacking.XFrameOptionsMiddleware",
      "reversion.middleware.RevisionMiddleware",
  ]
  
  ROOT_URLCONF = "app.urls"
  
  TEMPLATES = [
      {
          "BACKEND": "django.template.backends.django.DjangoTemplates",
          "DIRS": [BASE_DIR, 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",
              ]
          },
      }
  ]
  
  REST_FRAMEWORK = {
      "DEFAULT_PAGINATION_CLASS": "core.pagination.StyledPagination",
      "PAGE_SIZE": 20,
      "DEFAULT_SCHEMA_CLASS": "rest_framework.schemas.coreapi.AutoSchema",
      "DATETIME_FORMAT": "%Y-%m-%dT%H:%M:%S.%fZ",
      "DEFAULT_RENDERER_CLASSES": (
          "djangorestframework_camel_case.render.CamelCaseJSONRenderer",
          "djangorestframework_camel_case.render.CamelCaseBrowsableAPIRenderer",
      ),
      "DEFAULT_PARSER_CLASSES": (
          "djangorestframework_camel_case.parser.CamelCaseFormParser",
          "djangorestframework_camel_case.parser.CamelCaseMultiPartParser",
          "djangorestframework_camel_case.parser.CamelCaseJSONParser",
      ),
  }
  
  WSGI_APPLICATION = "app.wsgi.application"
  
  
  # Database
  # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
  
  DATABASES = {
      "default": {
          "ENGINE": "django.db.backends.mysql",
          "HOST": os.getenv("DB_HOST"),
          "NAME": os.getenv("DB_NAME"),
          "USER": os.getenv("DB_USER"),
          "PASSWORD": os.getenv("DB_PASS"),
      },
  }
  
  # 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 = "ru-RU"
  
  TIME_ZONE = "Europe/Moscow"
  
  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/"
  MEDIA_URL = "/media/"
  
  STATIC_ROOT = os.path.join(BASE_DIR, "/vol/web/static")
  MEDIA_ROOT = os.path.join(BASE_DIR, "/vol/web/media")
  
  AUTH_USER_MODEL = "core.User"
  
  CORS_ALLOWED_ORIGINS = [
      "http://localhost:3000",
      "http://localhost:3001",
      "http://127.0.0.1:3000",
      "https://vk-mini-so.vercel.app",
      "https://app.so.spb.ru",
  ]
  CORS_ALLOWED_ORIGIN_REGEXES = [r"^https://\w+\.ngrok\.io$"]
  ADD_REVERSION_ADMIN = True
  
  ASGI_APPLICATION = "app.asgi.application"
  
  REDIS_HOST = os.getenv("REDIS_HOST")
  CHANNEL_LAYERS = {
      "default": {
          "BACKEND": "channels_redis.core.RedisChannelLayer",
          "CONFIG": {
              "hosts": [(REDIS_HOST, 6379)],
          },
      },
  }
  
  CACHES = {
      # … default cache config and others
      "default": {
          "BACKEND": "django_redis.cache.RedisCache",
          "LOCATION": f"redis://{REDIS_HOST}:6379/2",
          "OPTIONS": {
              "CLIENT_CLASS": "django_redis.client.DefaultClient",
          },
      },
      "select2": {
          "BACKEND": "django_redis.cache.RedisCache",
          "LOCATION": f"redis://{REDIS_HOST}:6379/2",
          "OPTIONS": {
              "CLIENT_CLASS": "django_redis.client.DefaultClient",
          },
      },
  }
  
  # Tell select2 which cache configuration to use:
  SELECT2_CACHE_BACKEND = "select2"
  