text: """
  Django settings for coprop project.
  
  Generated by 'django-admin startproject' using Django 1.10.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/dev/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/dev/ref/settings/
  """
  
  import os
  import datetime
  import environ
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  from django.urls import reverse_lazy
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  
  env = environ.Env()
  environ.Env.read_env(os.path.join(BASE_DIR, ".env"))
  
  ENV_PRODUCTION = "production"
  ENV_STAGING = "staging"
  ENV_DEVELOPMENT = "development"
  
  CURRENT_ENV = env.str("ENV", ENV_PRODUCTION)
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = env.str("SECRET_KEY", "secret")
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = env.bool("DEBUG", False)
  
  ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=(
      "*",
  ))
  
  # Application definition
  
  INSTALLED_APPS = [
      'bootstrap_admin',
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'django.contrib.humanize',
      'django_filters',
      'rest_framework',
      'reversion',
      'apps.prop',
      'apps.administration',
  ]
  
  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',
      'reversion.middleware.RevisionMiddleware',
  
      # app middleware
      'apps.prop.middleware.CurrentCountyMiddleware',
  ]
  
  REST_FRAMEWORK = {
      'EXCEPTION_HANDLER': 'project.helpers.utils.custom_rest_exception_handler',
      'DEFAULT_PERMISSION_CLASSES': [
          'project.helpers.utils.CustomDjangoModelPermissions'
      ],
      'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.URLPathVersioning',
      'DEFAULT_VERSION': 'v1',
      'ALLOWED_VERSIONS': ['v1'],
      'VERSION_PARAM': 'version',
      'DEFAULT_PAGINATION_CLASS': 'project.helpers.utils.CustomPagination',
      'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',
                                  'rest_framework.filters.OrderingFilter'),
      'PAGE_SIZE': 25,
      'MAX_PAGE_SIZE_DEFAULT': 200,
      'TEST_REQUEST_DEFAULT_FORMAT': 'json',
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.SessionAuthentication',
          'rest_framework.authentication.BasicAuthentication',
          'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
      ),
  }
  
  JWT_AUTH = {
      'JWT_ENCODE_HANDLER':
      'rest_framework_jwt.utils.jwt_encode_handler',
  
      'JWT_DECODE_HANDLER':
      'rest_framework_jwt.utils.jwt_decode_handler',
  
      'JWT_PAYLOAD_HANDLER':
      'rest_framework_jwt.utils.jwt_payload_handler',
  
      'JWT_PAYLOAD_GET_USER_ID_HANDLER':
      'rest_framework_jwt.utils.jwt_get_user_id_from_payload_handler',
  
      'JWT_RESPONSE_PAYLOAD_HANDLER':
      'rest_framework_jwt.utils.jwt_response_payload_handler',
  
      'JWT_SECRET_KEY': SECRET_KEY,
      'JWT_ALGORITHM': 'HS256',
      'JWT_VERIFY': True,
      'JWT_VERIFY_EXPIRATION': True,
      'JWT_LEEWAY': 0,
      'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=36000),
      'JWT_AUDIENCE': None,
      'JWT_ISSUER': None,
  
      'JWT_ALLOW_REFRESH': False,
      'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7),
  
      'JWT_AUTH_HEADER_PREFIX': 'Codata',
  }
  
  ROOT_URLCONF = 'project.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [
              os.path.join(BASE_DIR, 'project', 'templates'),
          ],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
                  'django.template.context_processors.i18n',
                  'django.template.context_processors.media',
                  'django.template.context_processors.static',
                  'django.template.context_processors.tz',
                  'django.template.context_processors.request',
              ],
              'libraries': {
                  'util_tags': 'project.templatetags.util_tags',
              }
          },
      },
  ]
  
  BOOTSTRAP_ADMIN_SIDEBAR_MENU = True
  
  WSGI_APPLICATION = 'project.wsgi.application'
  
  LOGIN_URL = reverse_lazy('login')
  LOGIN_REDIRECT_URL = reverse_lazy('index')
  
  
  # Database
  # https://docs.djangoproject.com/en/dev/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'formatters': {
          'verbose': {
              'format': '[%(asctime)s] %(levelname)s %(pathname)s:%(lineno)d %(message)s'
          },
          'simple': {
              'format': '[%(asctime)s] %(levelname)s %(message)s'
          },
      },
      'handlers': {
          'console': {
              'class': 'logging.StreamHandler',
              'formatter': 'verbose',
          },
          'mail_admins': {
              'level': 'ERROR',
              'class': 'django.utils.log.AdminEmailHandler',
              'formatter': 'verbose',
          }
      },
      'loggers': {
          'django': {
              'handlers': ['console'],
              'propagate': True,
          },
          'django.request': {
              'handlers': ['mail_admins'],
              'level': 'ERROR',
              'propagate': True,
          },
      }
  }
  
  CACHES = {
      "default": {
          "BACKEND": "django_redis.cache.RedisCache",
          "LOCATION": "redis://127.0.0.1:6379/1",
          "TIMEOUT": 3600,  # 1 hour,
          "KEY_PREFIX": "coprop::",
          "OPTIONS": {
              "CLIENT_CLASS": "django_redis.client.DefaultClient",
          }
      }
  }
  
  # Password validation
  # https://docs.djangoproject.com/en/dev/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/dev/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/dev/howto/static-files/
  
  STATIC_URL = '/static/'
  STATIC_ROOT = os.path.join(BASE_DIR, "collected_static")
  
  STATICFILES_DIRS = (
      os.path.join(BASE_DIR, "static"),
  )
  
  MEDIA_URL = '/media/'
  MEDIA_ROOT = os.path.join(BASE_DIR, "media")
  
  # coprop specific settings
  