text: """
  Django settings for DEOnlineJudge project.
  
  Generated by 'django-admin startproject' using Django 1.8.3.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/1.8/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/1.8/ref/settings/
  """
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  import os
  
  from kombu import Exchange, Queue
  
  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/1.8/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'e1#h#d2+fe4rhi!92hvyj#+wwb0s#bct&0pq+arb=qet0hj*kd'
  
  # 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',
      'rest_framework',
      'tinymce',
      'django_wysiwyg',
      'djcelery',
      'django_gravatar',
  
      'system.users',
  
      'app.account',
      'app.index',
      'app.problem',
      'app.record',
      'app.node',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
      'django.middleware.security.SecurityMiddleware',
  )
  
  ROOT_URLCONF = 'DEOnlineJudge.urls'
  
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [
              os.path.join(BASE_DIR, 'templates'),
          ],
          '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 = 'DEOnlineJudge.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/1.8/topics/i18n/
  
  LANGUAGE_CODE = 'zh-hans'
  
  TIME_ZONE = 'Asia/Shanghai'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.8/howto/static-files/
  
  STATIC_URL = '/static/'
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  STATICFILES_DIRS = (
      os.path.join(BASE_DIR, "static"),
  )
  
  AUTH_USER_MODEL = 'users.User'
  
  # REST FRAMEWORK
  
  REST_FRAMEWORK = {
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.BasicAuthentication',
          'rest_framework.authentication.SessionAuthentication',
      ),
      'DEFAULT_FILTER_BACKENDS': (
          'rest_framework.filters.DjangoFilterBackend',
          'rest_framework.filters.SearchFilter',
          'rest_framework.filters.OrderingFilter',
      ),
      'PAGINATE_BY': 10,
      'PAGINATE_BY_PARAM': 'per_page',
      'MAX_PAGINATE_BY': 100,
  }
  
  BROKER_URL = 'redis://localhost:6379/0'
  CELERY_RESULT_BACKEND = 'redis://localhost:6379/1'
  CELERY_DEFAULT_QUEUE = 'default'
  CELERY_DEFAULT_ROUTING_KEY = 'default'
  CELERY_TASK_RESULT_EXPIRES = 3600
  CELERY_QUEUES = (
      Queue('default', routing_key='default'),
  )
  CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
  
  DJANGO_WYSIWYG_FLAVOR = "tinymce"
  
  GRAVATAR_URL = 'http://gravatar.duoshuo.com/'
  
  try:
      from local_settings import *
  except ImportError:
      pass
  