chroma新增、删除、知识库应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
4.8 KiB

  1. """
  2. Django settings for Zhijian_Project_WebService project.
  3. Generated by 'django-admin startproject' using Django 1.8.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.8/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.8/ref/settings/
  8. """
  9. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  10. import os
  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.8/howto/deployment/checklist/
  14. # SECURITY WARNING: keep the secret key used in production secret!
  15. SECRET_KEY = '330r)_!^qhd7$!w4)$y@4=p2bd*vlxf%4z(bx-fx-1i3txagvz'
  16. # SECURITY WARNING: don't run with debug turned on in production!
  17. DEBUG = True
  18. ALLOWED_HOSTS = ['*']
  19. # Application definition
  20. INSTALLED_APPS = (
  21. 'django.contrib.admin',
  22. 'django.contrib.auth',
  23. 'django.contrib.contenttypes',
  24. 'django.contrib.sessions',
  25. 'django.contrib.messages',
  26. 'django.contrib.staticfiles',
  27. )
  28. MIDDLEWARE = [
  29. 'django.contrib.sessions.middleware.SessionMiddleware',
  30. 'django.middleware.common.CommonMiddleware',
  31. 'django.middleware.csrf.CsrfViewMiddleware',
  32. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  33. # 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  34. 'django.contrib.messages.middleware.MessageMiddleware',
  35. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  36. 'django.middleware.security.SecurityMiddleware',
  37. ]
  38. ROOT_URLCONF = 'text_analysis.urls'
  39. TEMPLATES = [
  40. {
  41. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  42. 'DIRS': [],
  43. 'APP_DIRS': True,
  44. 'OPTIONS': {
  45. 'context_processors': [
  46. 'django.template.context_processors.debug',
  47. 'django.template.context_processors.request',
  48. 'django.contrib.auth.context_processors.auth',
  49. 'django.contrib.messages.context_processors.messages',
  50. ],
  51. },
  52. },
  53. ]
  54. WSGI_APPLICATION = 'text_analysis.wsgi.application'
  55. # Database
  56. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  57. # DATABASES = {
  58. # 'default': {
  59. # 'ENGINE': 'django.db.backends.sqlite3',
  60. # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  61. # }
  62. # }
  63. # Internationalization
  64. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  65. LANGUAGE_CODE = 'en-us'
  66. TIME_ZONE = 'UTC'
  67. USE_I18N = True
  68. USE_L10N = True
  69. USE_TZ = True
  70. # Static files (CSS, JavaScript, Images)
  71. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  72. STATIC_URL = '/static/'
  73. U_LOGFILE_SIZE = 1 * 1024 * 1024 # 单日志文件最大100M
  74. U_LOGFILE_COUNT = 3 # 保留10个日志文件
  75. # LOGGING = {
  76. # 'version': 1,
  77. # 'disable_existing_loggers': True, # 禁用所有已经存在的日志配置
  78. # 'filters': {
  79. # 'require_debug_false': {
  80. # '()': 'django.utils.log.RequireDebugFalse'
  81. # }
  82. # },
  83. # 'formatters': {
  84. # 'verbose': {
  85. # 'format': '[%(levelname)s %(asctime)s @ %(process)d] %(module)s %(process)d %(thread)d %(message)s'
  86. # },
  87. # 'simple': {
  88. # 'format': '%(levelname)s %(asctime)s @ %(process)d %(message)s'
  89. # },
  90. # 'complete': {
  91. # 'format': '[%(levelname)s %(asctime)s @ %(process)d] (%(pathname)s/%(funcName)s:%(lineno)d) - %(message)s'
  92. # },
  93. # 'online': {
  94. # 'format': '[%(levelname)s %(asctime)s @ %(process)d] - %(message)s'
  95. # }
  96. # },
  97. # 'handlers': {
  98. # 'text': {
  99. # 'level': 'DEBUG',
  100. # #'class': 'logging.handlers.RotatingFileHandler',
  101. # 'class': 'logging.handlers.TimedRotatingFileHandler',
  102. # 'when': 'midnight',
  103. # 'interval': 1,
  104. # 'backupCount': U_LOGFILE_COUNT,
  105. # 'formatter': 'complete',
  106. # 'filename': os.path.join(BASE_DIR, 'logs/parse_excel.log').replace('\\', '/'),
  107. # },
  108. # 'excel_req': {
  109. # 'level': 'DEBUG',
  110. # #'class': 'logging.handlers.RotatingFileHandler',
  111. # 'class': 'logging.handlers.TimedRotatingFileHandler',
  112. # #'maxBytes': U_LOGFILE_SIZE,
  113. # 'when': 'midnight',
  114. # 'interval': 1,
  115. # 'backupCount': U_LOGFILE_COUNT,
  116. # 'formatter': 'online',
  117. # 'filename': os.path.join(BASE_DIR, 'logs/req_excel.log').replace('\\', '/'),
  118. # }
  119. # },
  120. # 'loggers': {
  121. # 'text': {
  122. # 'handlers': ['text'],
  123. # 'level': 'DEBUG',
  124. # 'propagate': False,
  125. # },
  126. # 'excel_req': {
  127. # 'handlers': ['excel_req'],
  128. # 'level': 'DEBUG',
  129. # 'propagate': False,
  130. # },
  131. # }
  132. # }