text: """
  Django settings for koora project.
  
  Generated by 'django-admin startproject' using Django 3.0.
  
  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__)))
  
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  
  SECRET_KEY = os.environ['SECRET_KEY']
  
  JWT_ALGORITHM = 'HS256'
  JWT_EXP_DELTA_SECONDS = 86400
  
  
  DEBUG = os.environ['DEBUG'] == 'TRUE'
  
  ADMIN_ENABLED = DEBUG
  
  ALLOWED_HOSTS = ['*']
  
  
  LOGIN_REDIRECT_URL = '/'
  LOGOUT_REDIRECT_URL = '/'
  SOCIAL_AUTH_URL_NAMESPACE = 'social'
  LOGIN_URL = '/auth/login/google-oauth2/'
  
  
  SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = os.environ['GOOGLE_OAUTH_CLIENT_ID']
  SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = os.environ['GOOGLE_OAUTH_CLIENT_SECRET']
  
  
  CSRF_FAILURE_VIEW = 'koora.views.csrf_fail'
  
  #Settings for Article Categories
  
  KOORA_CATEGORIES = [
      ('AR', 'ART'),
      ('FD', 'FOOD'),
      ('GM', 'GAMES'),
      ('RN', 'RANDOM'),
      ('SC', 'SCIENCE'),
      ('TS', 'TVSERIES'),
      ('TG', 'TECHNOLOGY'),
      ('LT', 'LITERATURE'),
      ('PH', 'PHILOSOPHY'),
      ('MM', 'MUSIC&MOVIES'),
  ]
  
  COUNTRIES = [
      ('AD', 'Andorra'),
      ('AE', 'United Arab Emirates'),
      ('AF', 'Afghanistan'),
      ('AG', 'Antigua & Barbuda'),
      ('AI', 'Anguilla'),
      ('AL', 'Albania'),
      ('AM', 'Armenia'),
      ('AN', 'Netherlands Antilles'),
      ('AO', 'Angola'),
      ('AQ', 'Antarctica'),
      ('AR', 'Argentina'),
      ('AS', 'American Samoa'),
      ('AT', 'Austria'),
      ('AU', 'Australia'),
      ('AW', 'Aruba'),
      ('AZ', 'Azerbaijan'),
      ('BA', 'Bosnia and Herzegovina'),
      ('BB', 'Barbados'),
      ('BD', 'Bangladesh'),
      ('BE', 'Belgium'),
      ('BF', 'Burkina Faso'),
      ('BG', 'Bulgaria'),
      ('BH', 'Bahrain'),
      ('BI', 'Burundi'),
      ('BJ', 'Benin'),
      ('BM', 'Bermuda'),
      ('BN', 'Brunei Darussalam'),
      ('BO', 'Bolivia'),
      ('BR', 'Brazil'),
      ('BS', 'Bahama'),
      ('BT', 'Bhutan'),
      ('BV', 'Bouvet Island'),
      ('BW', 'Botswana'),
      ('BY', 'Belarus'),
      ('BZ', 'Belize'),
      ('CA', 'Canada'),
      ('CC', 'Cocos (Keeling) Islands'),
      ('CF', 'Central African Republic'),
      ('CG', 'Congo'),
      ('CH', 'Switzerland'),
      ('CI', 'Ivory Coast'),
      ('CK', 'Cook Iislands'),
      ('CL', 'Chile'),
      ('CM', 'Cameroon'),
      ('CN', 'China'),
      ('CO', 'Colombia'),
      ('CR', 'Costa Rica'),
      ('CU', 'Cuba'),
      ('CV', 'Cape Verde'),
      ('CX', 'Christmas Island'),
      ('CY', 'Cyprus'),
      ('CZ', 'Czech Republic'),
      ('DE', 'Germany'),
      ('DJ', 'Djibouti'),
      ('DK', 'Denmark'),
      ('DM', 'Dominica'),
      ('DO', 'Dominican Republic'),
      ('DZ', 'Algeria'),
      ('EC', 'Ecuador'),
      ('EE', 'Estonia'),
      ('EG', 'Egypt'),
      ('EH', 'Western Sahara'),
      ('ER', 'Eritrea'),
      ('ES', 'Spain'),
      ('ET', 'Ethiopia'),
      ('FI', 'Finland'),
      ('FJ', 'Fiji'),
      ('FK', 'Falkland Islands (Malvinas)'),
      ('FM', 'Micronesia'),
      ('FO', 'Faroe Islands'),
      ('FR', 'France'),
      ('FX', 'France, Metropolitan'),
      ('GA', 'Gabon'),
      ('GB', 'United Kingdom (Great Britain)'),
      ('GD', 'Grenada'),
      ('GE', 'Georgia'),
      ('GF', 'French Guiana'),
      ('GH', 'Ghana'),
      ('GI', 'Gibraltar'),
      ('GL', 'Greenland'),
      ('GM', 'Gambia'),
      ('GN', 'Guinea'),
      ('GP', 'Guadeloupe'),
      ('GQ', 'Equatorial Guinea'),
      ('GR', 'Greece'),
      ('GS', 'South Georgia and the South Sandwich Islands'),
      ('GT', 'Guatemala'),
      ('GU', 'Guam'),
      ('GW', 'Guinea-Bissau'),
      ('GY', 'Guyana'),
      ('HK', 'Hong Kong'),
      ('HM', 'Heard & McDonald Islands'),
      ('HN', 'Honduras'),
      ('HR', 'Croatia'),
      ('HT', 'Haiti'),
      ('HU', 'Hungary'),
      ('ID', 'Indonesia'),
      ('IE', 'Ireland'),
      ('IL', 'Israel'),
      ('IN', 'India'),
      ('IO', 'British Indian Ocean Territory'),
      ('IQ', 'Iraq'),
      ('IR', 'Islamic Republic of Iran'),
      ('IS', 'Iceland'),
      ('IT', 'Italy'),
      ('JM', 'Jamaica'),
      ('JO', 'Jordan'),
      ('JP', 'Japan'),
      ('KE', 'Kenya'),
      ('KG', 'Kyrgyzstan'),
      ('KH', 'Cambodia'),
      ('KI', 'Kiribati'),
      ('KM', 'Comoros'),
      ('KN', 'St. Kitts and Nevis'),
      ('KP', 'Korea, Democratic People\'s Republic of'),
      ('KR', 'Korea, Republic of'),
      ('KW', 'Kuwait'),
      ('KY', 'Cayman Islands'),
      ('KZ', 'Kazakhstan'),
      ('LA', 'Lao People\'s Democratic Republic'),
      ('LB', 'Lebanon'),
      ('LC', 'Saint Lucia'),
      ('LI', 'Liechtenstein'),
      ('LK', 'Sri Lanka'),
      ('LR', 'Liberia'),
      ('LS', 'Lesotho'),
      ('LT', 'Lithuania'),
      ('LU', 'Luxembourg'),
      ('LV', 'Latvia'),
      ('LY', 'Libyan Arab Jamahiriya'),
      ('MA', 'Morocco'),
      ('MC', 'Monaco'),
      ('MD', 'Moldova, Republic of'),
      ('MG', 'Madagascar'),
      ('MH', 'Marshall Islands'),
      ('ML', 'Mali'),
      ('MN', 'Mongolia'),
      ('MM', 'Myanmar'),
      ('MO', 'Macau'),
      ('MP', 'Northern Mariana Islands'),
      ('MQ', 'Martinique'),
      ('MR', 'Mauritania'),
      ('MS', 'Monserrat'),
      ('MT', 'Malta'),
      ('MU', 'Mauritius'),
      ('MV', 'Maldives'),
      ('MW', 'Malawi'),
      ('MX', 'Mexico'),
      ('MY', 'Malaysia'),
      ('MZ', 'Mozambique'),
      ('NA', 'Namibia'),
      ('NC', 'New Caledonia'),
      ('NE', 'Niger'),
      ('NF', 'Norfolk Island'),
      ('NG', 'Nigeria'),
      ('NI', 'Nicaragua'),
      ('NL', 'Netherlands'),
      ('NO', 'Norway'),
      ('NP', 'Nepal'),
      ('NR', 'Nauru'),
      ('NU', 'Niue'),
      ('NZ', 'New Zealand'),
      ('OM', 'Oman'),
      ('PA', 'Panama'),
      ('PE', 'Peru'),
      ('PF', 'French Polynesia'),
      ('PG', 'Papua New Guinea'),
      ('PH', 'Philippines'),
      ('PK', 'Pakistan'),
      ('PL', 'Poland'),
      ('PM', 'St. Pierre & Miquelon'),
      ('PN', 'Pitcairn'),
      ('PR', 'Puerto Rico'),
      ('PT', 'Portugal'),
      ('PW', 'Palau'),
      ('PY', 'Paraguay'),
      ('QA', 'Qatar'),
      ('RE', 'Reunion'),
      ('RO', 'Romania'),
      ('RU', 'Russian Federation'),
      ('RW', 'Rwanda'),
      ('SA', 'Saudi Arabia'),
      ('SB', 'Solomon Islands'),
      ('SC', 'Seychelles'),
      ('SD', 'Sudan'),
      ('SE', 'Sweden'),
      ('SG', 'Singapore'),
      ('SH', 'St. Helena'),
      ('SI', 'Slovenia'),
      ('SJ', 'Svalbard & Jan Mayen Islands'),
      ('SK', 'Slovakia'),
      ('SL', 'Sierra Leone'),
      ('SM', 'San Marino'),
      ('SN', 'Senegal'),
      ('SO', 'Somalia'),
      ('SR', 'Suriname'),
      ('ST', 'Sao Tome & Principe'),
      ('SV', 'El Salvador'),
      ('SY', 'Syrian Arab Republic'),
      ('SZ', 'Swaziland'),
      ('TC', 'Turks & Caicos Islands'),
      ('TD', 'Chad'),
      ('TF', 'French Southern Territories'),
      ('TG', 'Togo'),
      ('TH', 'Thailand'),
      ('TJ', 'Tajikistan'),
      ('TK', 'Tokelau'),
      ('TM', 'Turkmenistan'),
      ('TN', 'Tunisia'),
      ('TO', 'Tonga'),
      ('TP', 'East Timor'),
      ('TR', 'Turkey'),
      ('TT', 'Trinidad & Tobago'),
      ('TV', 'Tuvalu'),
      ('TW', 'Taiwan, Province of China'),
      ('TZ', 'Tanzania, United Republic of'),
      ('UA', 'Ukraine'),
      ('UG', 'Uganda'),
      ('UM', 'United States Minor Outlying Islands'),
      ('US', 'United States of America'),
      ('UY', 'Uruguay'),
      ('UZ', 'Uzbekistan'),
      ('VA', 'Vatican City State (Holy See)'),
      ('VC', 'St. Vincent & the Grenadines'),
      ('VE', 'Venezuela'),
      ('VG', 'British Virgin Islands'),
      ('VI', 'United States Virgin Islands'),
      ('VN', 'Viet Nam'),
      ('VU', 'Vanuatu'),
      ('WF', 'Wallis & Futuna Islands'),
      ('WS', 'Samoa'),
      ('YE', 'Yemen'),
      ('YT', 'Mayotte'),
      ('YU', 'Yugoslavia'),
      ('ZA', 'South Africa'),
      ('ZM', 'Zambia'),
      ('ZR', 'Zaire'),
      ('ZW', 'Zimbabwe'),
      ('ZZ', 'Unknown or unspecified country'),
  ]
  
  EMAIL_HOST=os.environ['EMAIL_HOST']
  EMAIL_PORT=os.environ['EMAIL_PORT']
  EMAIL_HOST_USER=os.environ['EMAIL_HOST_USER']
  EMAIL_HOST_PASSWORD=os.environ['EMAIL_HOST_PASSWORD']
  EMAIL_USE_TLS=True
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'boto3',
      'social_django',
      'django_social_share',
      'django.contrib.admin',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.humanize',
      'django.contrib.staticfiles',
      'django.contrib.contenttypes',
      'articles.apps.ArticlesConfig',
      'user.apps.UserConfig',
      'comments.apps.CommentsConfig',
      'django.contrib.auth',
      'authentication.apps.AuthenticationConfig',
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'authentication.middlewares.AuthMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  
  ]
  
  AUTHENTICATION_BACKENDS = (
      'social_core.backends.google.GoogleOAuth2',
      'django.contrib.auth.backends.ModelBackend',
  )
  
  
  if not DEBUG:  # adding after the security middleware
      MIDDLEWARE.insert(1, 'whitenoise.middleware.WhiteNoiseMiddleware')
  
  
  ROOT_URLCONF = 'koora.urls'
  
  TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [ TEMPLATE_DIR, ],
          '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',
                  'koora.context.interceptor'
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'koora.wsgi.application'
  
  
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  if os.environ['PY_ENV'] == 'production':
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.' + os.environ['DB_ENGINE'],
              'NAME': os.environ['DB_NAME'],
              'USER': os.environ['DB_USER'],
              'PASSWORD': os.environ['DB_PASSWORD'],
              'HOST': os.environ['DB_HOST'],
              'PORT': os.environ['DB_PORT'],
          }
      }
  
  
  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
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  
  STATIC_URL = '/static/'
  
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  
  STATICFILES_DIRS = [ os.path.join(BASE_DIR, "assets"), ]
  
  # EMAIL_HOST = 'smtp.gmail.com'
  # EMAIL_HOST_USER = 'dipeshlama4869@gmail.com'
  # EMAIL_HOST_PASSWORD = 'mikasaeren4869'
  # EMAIL_PORT = 587
  # EMAIL_USE_TLS = True
  # EMAIL_USE_SSL = False
  # MEDIA_URL = '/media/'
  
  # MEDIA_ROOT = os.path.join(BASE_DIR,'media')
  
  
  