settings.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. import os
  2. import spacy
  3. import en_core_web_md
  4. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  5. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  6. # SECURITY WARNING: keep the secret key used in production secret!
  7. SECRET_KEY = '0t@j@klm8b@2rdl@po$$24pirh$&cg#p6f#)@$@n8^kn7k2%9b'
  8. # SECURITY WARNING: don't run with debug turned on in production!
  9. DEBUG = True
  10. ALLOWED_HOSTS = ['10.0.0.17', '127.0.0.1']
  11. # Application definition
  12. INSTALLED_APPS = [
  13. 'django.contrib.admin',
  14. 'django.contrib.auth',
  15. 'django.contrib.contenttypes',
  16. 'django.contrib.sessions',
  17. 'django.contrib.messages',
  18. 'django.contrib.staticfiles',
  19. 'gauth.apps.GauthConfig',
  20. 'review.apps.ReviewConfig',
  21. 'dashboard.apps.DashboardConfig',
  22. 'nlu_job.apps.NluJobConfig',
  23. 'analytics.apps.AnalyticsConfig',
  24. 'crispy_forms',
  25. 'django_crontab',
  26. ]
  27. MIDDLEWARE = [
  28. 'django.middleware.security.SecurityMiddleware',
  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.messages.middleware.MessageMiddleware',
  34. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  35. ]
  36. ROOT_URLCONF = 'review_automation.urls'
  37. TEMPLATES = [
  38. {
  39. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  40. 'DIRS': [],
  41. 'APP_DIRS': True,
  42. 'OPTIONS': {
  43. 'context_processors': [
  44. 'django.template.context_processors.debug',
  45. 'django.template.context_processors.request',
  46. 'django.contrib.auth.context_processors.auth',
  47. 'django.contrib.messages.context_processors.messages',
  48. ],
  49. },
  50. },
  51. ]
  52. WSGI_APPLICATION = 'review_automation.wsgi.application'
  53. # Database
  54. DATABASES = {
  55. 'default': {
  56. 'ENGINE': 'django.db.backends.mysql',
  57. 'NAME': 'review_automation',
  58. 'USER': 'root',
  59. 'PASSWORD': 'sad2002S1',
  60. 'HOST': 'localhost',
  61. 'PORT': '3306',
  62. }
  63. }
  64. # Password validation
  65. AUTH_PASSWORD_VALIDATORS = [
  66. {
  67. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  68. },
  69. {
  70. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  71. },
  72. {
  73. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  74. },
  75. {
  76. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  77. },
  78. ]
  79. # Internationalization
  80. LANGUAGE_CODE = 'en-us'
  81. TIME_ZONE = 'UTC'
  82. USE_I18N = True
  83. USE_L10N = True
  84. USE_TZ = True
  85. # Static files (CSS, JavaScript, Images)
  86. STATIC_URL = '/static/'
  87. LOGIN_URL = '/admin/login'
  88. LOGIN_REDIRECT_URL = '/'
  89. CRISPY_TEMPLATE_PACK = 'bootstrap4'
  90. # Google credentials
  91. CLIENT_ID = "174657415928-0bt50gt42pslq47gf21ao67n15rom96r.apps.googleusercontent.com"
  92. CLIENT_SECRET = "ZXYpt07Su0pW3y3jPGOXY_C_"
  93. TOKEN_URI = "https://oauth2.googleapis.com/token"
  94. HOST_URI = "http://127.0.0.1:8000"
  95. NLU_SERVER_URI = 'http://localhost:5005'
  96. # Cron-Jobs of the project
  97. CRONJOBS = [
  98. ('*/10 * * * *', 'review.review_utils.populate_reviews'),
  99. ]
  100. # spaCy model
  101. MODEL = spacy.load('en_core_web_md')