base.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #coding=utf-8
  2. """
  3. Django settings for cloud_defense project.
  4. Generated by 'django-admin startproject' using Django 1.11.1.
  5. For more information on this file, see
  6. https://docs.djangoproject.com/en/1.11/topics/settings/
  7. For the full list of settings and their values, see
  8. https://docs.djangoproject.com/en/1.11/ref/settings/
  9. """
  10. import os
  11. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  12. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = '19r&eh*ykwhtyg@zr0zvo(wnr_5y8qg5-1!0=a*!!$!pf3smi6'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = False
  19. ALLOWED_HOSTS = [
  20. "*"
  21. ]
  22. # Application definition
  23. INSTALLED_APPS = [
  24. 'django.contrib.admin',
  25. 'django.contrib.auth',
  26. 'django.contrib.contenttypes',
  27. 'django.contrib.sessions',
  28. 'django.contrib.messages',
  29. 'django.contrib.staticfiles',
  30. 'common',
  31. 'account',
  32. 'bzyifeng',
  33. 'weixin',
  34. 'manage'
  35. ]
  36. MIDDLEWARE = [
  37. 'django.middleware.security.SecurityMiddleware',
  38. 'django.contrib.sessions.middleware.SessionMiddleware',
  39. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  40. #'django.middleware.cache.CacheMiddleware',
  41. 'django.middleware.common.CommonMiddleware',
  42. 'django.middleware.csrf.CsrfViewMiddleware',
  43. 'django.contrib.messages.middleware.MessageMiddleware',
  44. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  45. #'operation_log.OpLogMiddleware.OpLogMiddleware'
  46. ]
  47. ROOT_URLCONF = 'urls'
  48. TEMPLATES = [
  49. {
  50. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  51. 'DIRS': [os.path.join(BASE_DIR,"../templates"),],
  52. 'APP_DIRS': True,
  53. 'OPTIONS': {
  54. 'context_processors': [
  55. 'django.template.context_processors.debug',
  56. 'django.template.context_processors.request',
  57. 'django.contrib.auth.context_processors.auth',
  58. 'django.contrib.messages.context_processors.messages',
  59. ],
  60. },
  61. },
  62. ]
  63. WSGI_APPLICATION = 'wsgi.application'
  64. # Password validation
  65. # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
  66. AUTH_PASSWORD_VALIDATORS = [
  67. {
  68. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  69. },
  70. {
  71. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  72. },
  73. {
  74. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  75. },
  76. {
  77. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  78. },
  79. ]
  80. # Internationalization
  81. # https://docs.djangoproject.com/en/1.11/topics/i18n/
  82. LANGUAGE_CODE = 'zh-hans'
  83. TIME_ZONE = 'Asia/Shanghai'
  84. USE_I18N = True
  85. USE_L10N = True
  86. USE_TZ = False
  87. DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
  88. # Static files (CSS, JavaScript, Images)
  89. # https://docs.djangoproject.com/en/1.11/howto/static-files/
  90. STATIC_URL = '/static/'
  91. STATICFILES_DIRS = (
  92. (os.path.join(BASE_DIR, '../static')),
  93. ('/mnt/bzyifeng/static'),
  94. )
  95. STATIC_ROOT = '/mnt/bzyifeng/static'
  96. print STATICFILES_DIRS,99999999999999
  97. # 节点上报超时配置(单位:秒)
  98. SERVER_REPORT_TIMEOUT = 60 * 10
  99. AUTHENTICATION_BACKENDS = [
  100. "account.cauth.AccountManage",
  101. ]
  102. PROJECT_NAME = u""