text: """
  Django settings for order_food_online project.
  Generated by 'django-admin startproject' using Django 2.1.5.
  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
  from django.utils.translation import gettext_lazy as _
  
  # 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 = '$pu=_%6bm*nr^6%o=^#!2&^4e26!f^zv2zo&woo=f4@x2h&re1'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = ['*']
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  
      'foods',
      'notes',
      'authentication',
  
      'rest_framework',
      'rest_framework.authtoken',
      'rest_auth',
      'channels',
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.locale.LocaleMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'order_food_online.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 = 'order_food_online.wsgi.application'
  
  # Database
  # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql',
          'NAME': os.getenv('POSTGRES_DB', 'order_food_db'),
          'USER': os.getenv('POSTGRES_USER', 'admin'),
          'PASSWORD': os.getenv('POSTGRES_PASSWORD', '123'),
          'HOST': os.getenv('POSTGRES_HOST', 'db'),
          'PORT': os.getenv('POSTGRES_PORT', 5432)
      }
  }
  
  # 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',
      },
  ]
  
  AUTH_USER_MODEL = 'authentication.CustomUser'
  
  # Internationalization
  # https://docs.djangoproject.com/en/2.1/topics/i18n/
  
  LANGUAGE_CODE = 'en'
  
  LANGUAGES = [
      ('en', _('English')),
      ('ru', _('Russian')),
  ]
  
  LOCALE_PATHS = (
      os.path.join(BASE_DIR, 'locale'),
  )
  
  TIME_ZONE = 'Europe/Kiev'
  
  USE_I18N = True
  
  USE_L10N = False
  
  USE_TZ = True
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/2.1/howto/static-files/
  
  MEDIA_URL = '/media/'
  
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  
  STATIC_URL = '/static/'
  
  STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
  
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  
  # FIXTURES
  
  FIXTURE_DIRS = (
      os.path.join(BASE_DIR, 'fixtures'),
  )
  
  # REDIRECTS
  
  LOGIN_REDIRECT_URL = '/'
  
  LOGOUT_REDIRECT_URL = '/'
  
  # CELERY
  
  CELERY_BROKER_URL = 'redis://redis:6379'
  
  CELERY_RESULT_BACKEND = 'redis://redis:6379'
  
  CELERY_ACCEPT_CONTENT = ['application/json']
  
  CELERY_TASK_SERIALIZER = 'json'
  
  CELERY_RESULT_SERIALIZER = 'json'
  
  CELERY_TIMEZONE = 'Europe/Kiev'
  
  # DJANGO REST FRAMEWORK SETTINGS
  
  REST_FRAMEWORK = {
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
      'PAGE_SIZE': 5,
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.BasicAuthentication',
          'rest_framework.authentication.SessionAuthentication',
          'rest_framework.authentication.TokenAuthentication',
      ),
      'DEFAULT_PERMISSION_CLASSES': (
          'rest_framework.permissions.AllowAny',
          'rest_framework.permissions.IsAuthenticated',
          'rest_framework.permissions.IsAuthenticatedOrReadOnly',
      ),
  }
  
  # DJANGO CHANNELS
  
  ASGI_APPLICATION = "order_food_online.routing.application"
  
  CHANNEL_LAYERS = {
      "default": {
          "BACKEND": "channels_redis.core.RedisChannelLayer",
          "CONFIG": {
              "hosts": [
                  (
                      os.getenv('REDIS_HOST', 'redis'),
                      os.getenv('REDIS_PORT', 6379)
                  )
              ],
          },
      },
  }
  