text: """
  Django settings for ProjectShop project.
  
  Generated by 'django-admin startproject' using Django 3.2.6.
  
  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/
  """
  
  import os
  from datetime import timedelta
  from pathlib import Path
  
  from dotenv import load_dotenv
  
  
  load_dotenv(".env.django")
  
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
  BASE_DIR = Path(__file__).resolve().parent.parent
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/3.2/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 = int(os.environ.get("DEBUG", default=0))
  
  ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
  
  # Application definition
  
  INSTALLED_APPS = [
      # django apps
      "django.contrib.admin",
      "django.contrib.auth",
      "django.contrib.contenttypes",
      "django.contrib.sessions",
      "django.contrib.messages",
      "django.contrib.staticfiles",
      "django.contrib.sites",
      "django.contrib.flatpages",
    
      # 3rd-party apps
      "rest_framework",
      "rest_framework_simplejwt.token_blacklist",
      "django_countries",
      'django_extensions',
      "phonenumber_field",
      "crispy_forms",
      "drf_yasg",
      "ckeditor",
      "ckeditor_uploader",
      'debug_toolbar',
      "import_export",
    
      # local apps
      'UserApp',
      'Shipping',
      'order',
      'ProductApp',
      ]
  
  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",
      'debug_toolbar.middleware.DebugToolbarMiddleware',
  ]
  
  ROOT_URLCONF = "ProjectShop.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 = "ProjectShop.wsgi.application"
  
  # Database
  # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  
  DATABASES = {
      "default": {
          "ENGINE": os.environ.get("SQL_ENGINE"),
          "NAME": os.environ.get("SQL_DATABASE"),
          "USER": os.environ.get("SQL_USER"),
          "PASSWORD": os.environ.get("SQL_PASSWORD"),
          "HOST": os.environ.get("SQL_HOST"),
          "PORT": os.environ.get("SQL_PORT"),
      }
  }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",  # noqa: E501
      },
      {
          "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.2/topics/i18n/
  
  LANGUAGE_CODE = "en-us"
  
  TIME_ZONE = "Europe/Kiev"
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/3.2/howto/static-files/
  
  STATIC_URL = "/static/"
  STATICFILES_DIR = [str(BASE_DIR) + "/static"]
  # media files will be stored in 'media' folder
  MEDIA_URL = "/media/"
  MEDIA_ROOT = str(BASE_DIR) + "/media"
  
  CKEDITOR_UPLOAD_PATH = "ckeditor_uploads/"
  # Default primary key field type
  # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
  
  DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
  
  AUTH_USER_MODEL = "UserApp.User"
  
  MEDIA_URL = "/media/"
  
  MEDIA_ROOT = os.path.join(BASE_DIR, "media")
  
  SESSION_COOKIE_AGE = 1209601
  
  REST_FRAMEWORK = {
      "DEFAULT_PERMISSION_CLASSES": [
          "rest_framework.permissions.AllowAny",
      ],
      "DEFAULT_AUTHENTICATION_CLASSES": (
          "rest_framework_simplejwt.authentication.JWTAuthentication",
      ),
      "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
      "PAGE_SIZE": 5,
  }
  
  SIMPLE_JWT = {
      "ACCESS_TOKEN_LIFETIME": timedelta(minutes=5),
      "REFRESH_TOKEN_LIFETIME": timedelta(days=1),
      "ROTATE_REFRESH_TOKENS": True,
      "BLACKLIST_AFTER_ROTATION": True,
      "UPDATE_LAST_LOGIN": True,
      "ALGORITHM": "HS256",
      "SIGNING_KEY": os.environ.get("SIMPLE_JWT_SIGNING_KEY"),
      "VERIFYING_KEY": None,
      "AUDIENCE": None,
      "ISSUER": None,
      "JWK_URL": None,
      "LEEWAY": 0,
      "AUTH_HEADER_TYPES": ("Bearer", "JWT"),
      "AUTH_HEADER_NAME": "HTTP_AUTHORIZATION",
      "USER_ID_FIELD": "id",
      "USER_ID_CLAIM": "user_id",
      "USER_AUTHENTICATION_RULE": "rest_framework_simplejwt.authentication.default_user_authentication_rule",  # noqa: E501
      "AUTH_TOKEN_CLASSES": ("rest_framework_simplejwt.tokens.AccessToken",),
      "TOKEN_TYPE_CLAIM": "token_type",
      "JTI_CLAIM": "jti",
      "SLIDING_TOKEN_REFRESH_EXP_CLAIM": "refresh_exp",
      "SLIDING_TOKEN_LIFETIME": timedelta(minutes=5),
      "SLIDING_TOKEN_REFRESH_LIFETIME": timedelta(days=1),
  }
  
  AUTHENTICATION_BACKENDS = [
      "django.contrib.auth.backends.ModelBackend",
      "UserApp.backends.EmailBackend",
  ]
  
  LOGIN_REDIRECT_URL = "home"
  LOGIN_URL = "login"
  
  SITE_ID = 1
  
  EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
  EMAIL_HOST = "smtp.gmail.com"
  EMAIL_PORT = 587
  EMAIL_USE_TLS = True
  EMAIL_HOST_USER = os.environ.get("EMAIL_USER")
  EMAIL_HOST_PASSWORD = os.environ.get("EMAIL_PASS")
  
  INTERNAL_IPS = [
      '127.0.0.1',
  ]
  