text: """
  Django settings for oosc project.
  
  Generated by 'django-admin startproject' using Django 1.10.2.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/1.10/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/1.10/ref/settings/
  """
  
  import os
  import dj_database_url # 3rd party database config helper
  
  import sys
  reload(sys)
  sys.setdefaultencoding('utf8')
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  # from dateutil import parser
  # from django.forms import fields
  # fields.DateTimeField.strptime = lambda o, v, f: parser.parse(v)
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = '=l())7cafv22l7*yz)rf=g*kb@)0(f__e7$bp73!ibx#32k6e+'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  USE_X_FORWARDED_HOST = True
  SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  ALLOWED_HOSTS = ['*']
  CORS_ORIGIN_ALLOW_ALL=True
  USE_TZ=False
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'rest_framework',
      'oosc.subjects.apps.SubjectsConfig',
      'oosc.teachers.apps.TeachersConfig',
      'oosc.students.apps.StudentsConfig',
      'oosc.attendance.apps.AttendanceConfig',
      'oosc.parents.apps.ParentsConfig',
      'oosc.schools.apps.SchoolsConfig',
      'oosc.promotions.apps.PromotionsConfig',
      'oosc.counties.apps.CountiesConfig',
      'oosc.constituencies.apps.ConstituenciesConfig',
      'oosc.classes.apps.ClassesConfig',
      'oosc.stream.apps.StreamConfig',
      'oauth2_provider',
      'corsheaders',
      'oosc.zone.apps.ZoneConfig',
      'oosc.subcounty.apps.SubcountyConfig',
      'oosc.absence.apps.AbsenceConfig',
      'oosc.reason.apps.ReasonConfig',
      'oosc.partner.apps.PartnerConfig',
      'oosc.history.apps.HistoryConfig',
      'crispy_forms',
     # 'debug_toolbar',
  
  
  ]
  
  REST_FRAMEWORK = {
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'oauth2_provider.ext.rest_framework.OAuth2Authentication',
          'rest_framework.authentication.SessionAuthentication',
      ),
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
      'PAGE_SIZE': 100
  
  }
  
  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.gzip.GZipMiddleware',
      # 'debug_toolbar.middleware.DebugToolbarMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
      'corsheaders.middleware.CorsMiddleware',
      'django.middleware.common.CommonMiddleware',
  ]
  
  ROOT_URLCONF = 'oosc.config.urls'
  
  OAUTH2_PROVIDER = {
      'AUTHORIZATION_CODE_EXPIRE_SECONDS': 60 * 60,
      'ACCESS_TOKEN_EXPIRE_SECONDS': 60 * 60 * 24 * 365
  }
  INTERNAL_IPS=['127.0.0.1']
  ##To generate the dropout list weekly
  DROPOUT_MIN_COUNT=1
  
  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 = 'oosc.config.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
  
  # #Development Only
  # DATABASES = {
  #     'default': {
  #         'ENGINE': 'django.db.backends.sqlite3',
  #         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  #         'OPTIONS': {
  #             # ...
  #             'timeout': 5,
  #             # ...
  #         }
  #     }
  #
  # }
  
  #Production Only
  os.environ['TZ'] = 'Africa/Nairobi'
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
          'NAME': 'oosc',        # Or path to database file if using sqlite3.
          'USER': 'sisitech',                   # Not used with sqlite3.
          'PASSWORD': '#sisitech',            # Not used with sqlite3.
          'HOST': 'localhost',             # Set to empty string for localhost. Not used with sqlite3.
          'PORT': '5432',                  # Set to empty string for default. Not used with sqlite3.
      }
  }
  
  # CACHES = {
  #     'default': {
  #         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
  #         'LOCATION': '127.0.0.1:11211',
  #     }
  # }
  
  # Password validation
  # https://docs.djangoproject.com/en/1.10/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/1.10/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'Africa/Nairobi'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = False
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.10/howto/static-files/
  
  STATIC_URL = '/static/'
  
  # DEFAULT_FILE_STORAGE=os.path.join(BASE_DIR,'..','uploads')
  
  MEDIA_ROOT=os.path.join(BASE_DIR,'..','uploads')
  
  MEDIA_URL="/media/"
  
  
  