settings.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. """
  2. Django settings for st_cloud project.
  3. Generated by 'django-admin startproject' using Django 3.2.7.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/3.2/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/3.2/ref/settings/
  8. """
  9. from pathlib import Path
  10. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  11. BASE_DIR = Path(__file__).resolve().parent.parent
  12. # Quick-start development settings - unsuitable for production
  13. # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
  14. # SECURITY WARNING: keep the secret key used in production secret!
  15. SECRET_KEY = 'django-insecure-h1r^p(6-s&@7u!q(sv%_@97fxv(ikbi7d9p#i9+-o_3&pbpw(j'
  16. SALT = 'sa0v-038auwmd-r0awvy4-0y4vs9mdy9-aby09384vy-amr9tv8ybsva9v4y'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = []
  20. # Application definition
  21. INSTALLED_APPS = [
  22. 'django.contrib.admin',
  23. 'django.contrib.auth',
  24. 'django.contrib.contenttypes',
  25. 'django.contrib.sessions',
  26. 'django.contrib.messages',
  27. 'django.contrib.staticfiles',
  28. 'rest_framework',
  29. 'group',
  30. 'folder',
  31. 'file',
  32. 'account'
  33. ]
  34. MIDDLEWARE = [
  35. 'django.middleware.security.SecurityMiddleware',
  36. 'django.contrib.sessions.middleware.SessionMiddleware',
  37. 'django.middleware.common.CommonMiddleware',
  38. 'django.middleware.csrf.CsrfViewMiddleware',
  39. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  40. 'django.contrib.messages.middleware.MessageMiddleware',
  41. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  42. ]
  43. ROOT_URLCONF = 'st_cloud.urls'
  44. TEMPLATES = [
  45. {
  46. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  47. 'DIRS': [BASE_DIR / 'templates']
  48. ,
  49. 'APP_DIRS': True,
  50. 'OPTIONS': {
  51. 'context_processors': [
  52. 'django.template.context_processors.debug',
  53. 'django.template.context_processors.request',
  54. 'django.contrib.auth.context_processors.auth',
  55. 'django.contrib.messages.context_processors.messages',
  56. ],
  57. },
  58. },
  59. ]
  60. WSGI_APPLICATION = 'st_cloud.wsgi.application'
  61. # Database
  62. # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  63. DATABASES = {
  64. 'default': {
  65. 'ENGINE': 'django.db.backends.sqlite3',
  66. 'NAME': BASE_DIR / 'db.sqlite3',
  67. }
  68. }
  69. # Password validation
  70. # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
  71. PASSWORD_RESET_TIMEOUT = 3600
  72. AUTH_PASSWORD_VALIDATORS = [
  73. {
  74. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  75. },
  76. {
  77. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  78. },
  79. {
  80. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  81. },
  82. {
  83. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  84. },
  85. ]
  86. # Internationalization
  87. # https://docs.djangoproject.com/en/3.2/topics/i18n/
  88. LANGUAGE_CODE = 'en-us'
  89. TIME_ZONE = 'UTC'
  90. USE_I18N = True
  91. USE_L10N = True
  92. USE_TZ = True
  93. # Static files (CSS, JavaScript, Images)
  94. # https://docs.djangoproject.com/en/3.2/howto/static-files/
  95. STATIC_URL = '/static/'
  96. # Default primary key field type
  97. # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
  98. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  99. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  100. EMAIL_USE_TLS = True
  101. EMAIL_HOST = 'smtp.qq.com'
  102. EMAIL_PORT = 25
  103. EMAIL_HOST_USER = 'lin-xinyuan@qq.com'
  104. EMAIL_HOST_PASSWORD = 'terwmysqpvxaeahe'
  105. DEFAULT_FROM_EMAIL = f'ST网盘 <{EMAIL_HOST_USER}>'