text: # -*- coding: utf-8 -*-
  """
  Django settings for mysite project.
  
  Generated by 'django-admin startproject' using Django 2.2.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/2.2/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/2.2/ref/settings/
  """
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  import os
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'p1p2e^77+6ex*1@-s6hzcx7l3bx#g2q0w1za1c-x-1p@n6z^x*'
  
  # 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',
      'django.contrib.sitemaps',
      'django.contrib.sites',
  
      'compressor',
  
      'blog',
      'vmaig_auth',
      'vmaig_comments',
      'vmaig_system'
  )
  
  SITE_ID = 1
  
  MIDDLEWARE = (
      '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 = 'vmaig_blog.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',
              ],
          },
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/2.2/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/2.2/howto/static-files/
  
  STATIC_URL = '/static/'
  
  STATIC_ROOT = '/opt/vmaig_blog/static/'
  
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
      # other finders..
      'compressor.finders.CompressorFinder',
  )
  
  # compress js css压缩配置
  COMPRESS_ENABLED = True
  COMPRESS_OFFLINE = True
  
  # 设置user model
  AUTH_USER_MODEL = "vmaig_auth.VmaigUser"
  
  
  # log配置
  LOG_FILE = "/var/log/vmaig/all.log"
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': True,
      'filters': {
          'require_debug_false': {
              '()': 'django.utils.log.RequireDebugFalse'
          }
      },
      'formatters': {
          'simple': {
              'format': '[%(levelname)s] %(module)s : %(message)s'
          },
          'verbose': {
              'format': '[%(asctime)s] [%(levelname)s] %(module)s : %(message)s'
          }
      },
      'handlers': {
          'null': {
              'level': 'DEBUG',
              'class': 'logging.NullHandler',
          },
          'console': {
              'level': 'INFO',
              'class': 'logging.StreamHandler',
              'formatter': 'verbose'
          },
          'file': {
              'level': 'INFO',
              'class': 'logging.FileHandler',
              'formatter': 'verbose',
              'filename': LOG_FILE,
              'mode': 'a',
          },
          'mail_admins': {
              'level': 'ERROR',
              'class': 'django.utils.log.AdminEmailHandler',
              'filters': ['require_debug_false']
          }
      },
      'loggers': {
          '': {
              'handlers': ['file', 'console'],
              'level': 'INFO',
              'propagate': True,
          },
          'django': {
              'handlers': ['file', 'console'],
              'level': 'DEBUG',
              'propagate': True,
          },
          'django.request': {
              'handlers': ['mail_admins', 'console'],
              'level': 'ERROR',
              'propagate': True,
          },
      }
  }
  
  
  # 分页配置
  PAGE_NUM = 5
  
  # email配置
  # 如果想要支持ssl (比如qq邮箱) 见 https://github.com/bancek/django-smtp-ssl
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  EMAIL_HOST = ''                       # SMTP地址 例如: smtp.163.com
  EMAIL_PORT = 25                       # SMTP端口 例如: 25
  EMAIL_HOST_USER = ''                  # 我自己的邮箱 例如: xxxxxx@163.com
  EMAIL_HOST_PASSWORD = ''              # 我的邮箱密码 例如  xxxxxxxxx
  EMAIL_SUBJECT_PREFIX = u'vmaig'       # 为邮件Subject-line前缀,默认是'[django]'
  EMAIL_USE_TLS = True                  # 与SMTP服务器通信时，是否启动TLS链接(安全链接)。默认是false
  
  DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
  
  # 七牛配置
  QINIU_ACCESS_KEY = ''
  QINIU_SECRET_KEY = ''
  QINIU_BUCKET_NAME = ''
  QINIU_URL = ''
  
  # 网站标题等内容配置
  WEBSITE_TITLE = u'Vmaig'
  WEBSITE_WELCOME = u'欢迎来到Vmaig，有问题欢迎加qq群458788510'
  