settings.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Copyright © 2023 Ingram Micro Inc. All rights reserved.
  2. from pathlib import Path
  3. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  4. BASE_DIR = Path(__file__).resolve().parent.parent
  5. # Quick-start development settings - unsuitable for production
  6. # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
  7. # SECURITY WARNING: keep the secret key used in production secret!
  8. SECRET_KEY = 'django-insecure-21-94qjpg#ol-3e1a!*6t$i0)e!v%+1cnb^%pe%!l%1f*6$9jq'
  9. # SECURITY WARNING: don't run with debug turned on in production!
  10. DEBUG = True
  11. ALLOWED_HOSTS = ['*']
  12. AUTH_USER_MODEL = 'app.User'
  13. # Application definition
  14. INSTALLED_APPS = [
  15. 'django.contrib.admin',
  16. 'django.contrib.auth',
  17. 'django.contrib.contenttypes',
  18. 'django.contrib.sessions',
  19. 'django.contrib.messages',
  20. 'django.contrib.staticfiles',
  21. 'dj_cqrs',
  22. 'app',
  23. ]
  24. MIDDLEWARE = [
  25. 'django.middleware.security.SecurityMiddleware',
  26. 'django.contrib.sessions.middleware.SessionMiddleware',
  27. 'django.middleware.common.CommonMiddleware',
  28. 'django.middleware.csrf.CsrfViewMiddleware',
  29. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  30. 'django.contrib.messages.middleware.MessageMiddleware',
  31. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  32. ]
  33. ROOT_URLCONF = 'app.urls'
  34. TEMPLATES = [
  35. {
  36. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  37. 'DIRS': ['templates'],
  38. 'APP_DIRS': True,
  39. 'OPTIONS': {
  40. 'context_processors': [
  41. 'django.template.context_processors.debug',
  42. 'django.template.context_processors.request',
  43. 'django.contrib.auth.context_processors.auth',
  44. 'django.contrib.messages.context_processors.messages',
  45. ],
  46. },
  47. },
  48. ]
  49. WSGI_APPLICATION = 'app.wsgi.application'
  50. # Database
  51. # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  52. DATABASES = {
  53. 'default': {
  54. 'ENGINE': 'django.db.backends.postgresql',
  55. 'NAME': 'master_service',
  56. 'USER': 'master_service',
  57. 'PASSWORD': 'password',
  58. 'HOST': 'db_pgsql',
  59. 'PORT': '5432',
  60. 'CONN_MAX_AGE': 0,
  61. },
  62. }
  63. # Password validation
  64. # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
  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. # https://docs.djangoproject.com/en/3.2/topics/i18n/
  81. LANGUAGE_CODE = 'en-us'
  82. TIME_ZONE = 'UTC'
  83. USE_I18N = True
  84. USE_L10N = True
  85. USE_TZ = True
  86. # Static files (CSS, JavaScript, Images)
  87. # https://docs.djangoproject.com/en/3.2/howto/static-files/
  88. STATIC_URL = '/static/'
  89. # Default primary key field type
  90. # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
  91. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  92. CQRS = {
  93. 'transport': 'dj_cqrs.transport.rabbit_mq.RabbitMQTransport',
  94. 'host': 'rabbitmq',
  95. 'port': '5672',
  96. 'user': 'rabbitmq',
  97. 'password': 'password',
  98. }