settings.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. """
  2. Django settings for AhPestDjangoWeb project.
  3. Generated by 'django-admin startproject' using Django 1.11.13.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.11/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.11/ref/settings/
  8. """
  9. import os
  10. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  11. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  12. # Quick-start development settings - unsuitable for production
  13. # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
  14. # SECURITY WARNING: keep the secret key used in production secret!
  15. SECRET_KEY = 'xt_s0mv5kig&wak7p^jl5gx4ph@)#rvn+q^-o9jezjq_fja48t'
  16. # SECURITY WARNING: don't run with debug turned on in production!
  17. DEBUG = False
  18. ALLOWED_HOSTS = ['*',]
  19. QINIU_ACCESS_KEY = 'QQiUHtzzECnxapoHwo40RcIayl4YntiObCoDh4T7'
  20. QINIU_SECRET_KEY = 'vUPjp3kkkZlXY35_9i35MxB1DHgc921jK-bESQgh'
  21. QINIU_BUCKET_NAME = 'test'
  22. QINIU_BUCKET_DOMAIN = '7u2iif.com1.z0.glb.clouddn.com/'
  23. QINIU_SECURE_URL = False
  24. PREFIX_URL = 'http://'
  25. DEFAULT_FILE_STORAGE = 'qiniustorage.backends.QiniuStorage'
  26. # Application definition
  27. INSTALLED_APPS = [
  28. 'django.contrib.admin',
  29. 'django.contrib.auth',
  30. 'django.contrib.contenttypes',
  31. 'django.contrib.sessions',
  32. 'django.contrib.messages',
  33. 'django.contrib.staticfiles',
  34. 'web',
  35. ]
  36. MIDDLEWARE = [
  37. 'django.middleware.security.SecurityMiddleware',
  38. 'django.contrib.sessions.middleware.SessionMiddleware',
  39. 'django.middleware.common.CommonMiddleware',
  40. 'django.middleware.csrf.CsrfViewMiddleware',
  41. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  42. 'django.contrib.messages.middleware.MessageMiddleware',
  43. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  44. ]
  45. ROOT_URLCONF = 'AhPestDjangoWeb.urls'
  46. TEMPLATES = [
  47. {
  48. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  49. 'DIRS': [os.path.join(BASE_DIR, 'templates')]
  50. ,
  51. 'APP_DIRS': True,
  52. 'OPTIONS': {
  53. 'context_processors': [
  54. 'django.template.context_processors.debug',
  55. 'django.template.context_processors.request',
  56. 'django.contrib.auth.context_processors.auth',
  57. 'django.contrib.messages.context_processors.messages',
  58. ],
  59. },
  60. },
  61. ]
  62. WSGI_APPLICATION = 'AhPestDjangoWeb.wsgi.application'
  63. # Database
  64. # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
  65. DATABASES = {
  66. 'default': {
  67. 'ENGINE': 'django.db.backends.mysql',
  68. 'NAME': 'ahpest',
  69. 'USER': 'root',
  70. 'PASSWORD': 'ahau306306',
  71. 'HOST': 'db',
  72. 'PORT': '3306',
  73. }
  74. }
  75. # Password validation
  76. # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
  77. AUTH_PASSWORD_VALIDATORS = [
  78. {
  79. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  80. },
  81. {
  82. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  83. },
  84. {
  85. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  86. },
  87. {
  88. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  89. },
  90. ]
  91. # Internationalization
  92. # https://docs.djangoproject.com/en/1.11/topics/i18n/
  93. LANGUAGE_CODE = 'en-us'
  94. TIME_ZONE = 'UTC'
  95. USE_I18N = True
  96. USE_L10N = True
  97. USE_TZ = True
  98. # Static files (CSS, JavaScript, Images)
  99. # https://docs.djangoproject.com/en/1.11/howto/static-files/
  100. SITE_ROOT = os.path.dirname(os.path.abspath(__file__))
  101. SITE_ROOT = os.path.abspath(os.path.join(SITE_ROOT, '../'))
  102. STATIC_URL = '/static/'
  103. STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
  104. MEDIA_URL = '/media/'
  105. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')