2
0

settings.py 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. """
  2. Django settings for {{ project_name }} project.
  3. Generated by 'django-admin startproject' using Django {{ django_version }}.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
  8. """
  9. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  10. import os
  11. from django.utils.translation import gettext_lazy as _ # noqa
  12. PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  13. BASE_DIR = os.path.dirname(PROJECT_DIR)
  14. # Quick-start development settings - unsuitable for production
  15. # See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/
  16. # Application definition
  17. INSTALLED_APPS = [
  18. # Test
  19. 'wagtailcrx.tests.testapp',
  20. # Wagtail CRX (CodeRed Extensions)
  21. 'wagtailcrx',
  22. 'bootstrap4',
  23. 'modelcluster',
  24. 'taggit',
  25. 'wagtailcache',
  26. 'wagtailseo',
  27. # Wagtail
  28. 'wagtail.contrib.forms',
  29. 'wagtail.contrib.redirects',
  30. 'wagtail.embeds',
  31. 'wagtail.sites',
  32. 'wagtail.users',
  33. 'wagtail.snippets',
  34. 'wagtail.documents',
  35. 'wagtail.images',
  36. 'wagtail.search',
  37. 'wagtail',
  38. 'wagtail.contrib.settings',
  39. 'wagtail.contrib.modeladmin',
  40. 'wagtail.contrib.table_block',
  41. 'wagtail.admin',
  42. # Django
  43. 'django.contrib.admin',
  44. 'django.contrib.auth',
  45. 'django.contrib.contenttypes',
  46. 'django.contrib.sessions',
  47. 'django.contrib.messages',
  48. 'django.contrib.staticfiles',
  49. "django.contrib.sitemaps",
  50. ]
  51. MIDDLEWARE = [
  52. # Save pages to cache. Must be FIRST.
  53. 'wagtailcache.cache.UpdateCacheMiddleware',
  54. # Common functionality
  55. 'django.contrib.sessions.middleware.SessionMiddleware',
  56. 'django.contrib.messages.middleware.MessageMiddleware',
  57. 'django.middleware.common.CommonMiddleware',
  58. # Security
  59. 'django.middleware.csrf.CsrfViewMiddleware',
  60. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  61. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  62. 'django.middleware.security.SecurityMiddleware',
  63. # Error reporting. Uncomment this to receive emails when a 404 is triggered.
  64. # 'django.middleware.common.BrokenLinkEmailsMiddleware',
  65. # CMS functionality
  66. 'wagtail.contrib.redirects.middleware.RedirectMiddleware',
  67. # Fetch from cache. Must be LAST.
  68. 'wagtailcache.cache.FetchFromCacheMiddleware',
  69. ]
  70. ROOT_URLCONF = 'wagtailcrx.tests.urls'
  71. TEMPLATES = [
  72. {
  73. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  74. 'APP_DIRS': True,
  75. 'OPTIONS': {
  76. 'context_processors': [
  77. 'django.template.context_processors.debug',
  78. 'django.template.context_processors.request',
  79. 'django.contrib.auth.context_processors.auth',
  80. 'django.contrib.messages.context_processors.messages',
  81. 'wagtail.contrib.settings.context_processors.settings',
  82. ],
  83. },
  84. },
  85. ]
  86. # Database
  87. # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
  88. DATABASES = {
  89. 'default': {
  90. 'ENGINE': 'django.db.backends.sqlite3',
  91. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  92. 'TEST': {
  93. 'NAME': os.path.join(BASE_DIR, 'test_db.sqlite3'),
  94. }
  95. }
  96. }
  97. # Password validation
  98. # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#auth-password-validators
  99. AUTH_PASSWORD_VALIDATORS = [
  100. {
  101. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  102. },
  103. {
  104. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  105. },
  106. {
  107. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  108. },
  109. {
  110. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  111. },
  112. ]
  113. # Internationalization
  114. # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
  115. LANGUAGE_CODE = 'en-us'
  116. TIME_ZONE = 'America/New_York'
  117. USE_I18N = True
  118. USE_L10N = True
  119. USE_TZ = True
  120. # Static files (CSS, JavaScript, Images)
  121. # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
  122. STATICFILES_FINDERS = [
  123. 'django.contrib.staticfiles.finders.FileSystemFinder',
  124. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  125. ]
  126. STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  127. STATIC_URL = '/teststatic/'
  128. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  129. MEDIA_URL = '/testmedia/'
  130. # Login
  131. LOGIN_URL = 'wagtailadmin_login'
  132. LOGIN_REDIRECT_URL = 'wagtailadmin_home'
  133. # Wagtail settings
  134. WAGTAIL_SITE_NAME = ""
  135. WAGTAIL_ENABLE_UPDATE_CHECK = False
  136. WAGTAILSEARCH_BACKENDS = {
  137. 'default': {
  138. 'BACKEND': 'wagtail.search.backends.database',
  139. }
  140. }
  141. # Base URL to use when referring to full URLs within the Wagtail admin backend -
  142. # e.g. in notification emails. Don't include '/admin' or a trailing slash
  143. WAGTAILADMIN_BASE_URL = ''
  144. # Bootstrap
  145. BOOTSTRAP4 = {
  146. # set to blank since wagtailcrx already loads jquery and bootstrap
  147. 'jquery_url': '',
  148. 'base_url': '',
  149. # remove green highlight on inputs
  150. 'success_css_class': ''
  151. }
  152. # Tags
  153. TAGGIT_CASE_INSENSITIVE = True
  154. EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
  155. WAGTAIL_CACHE = False
  156. SECRET_KEY = 'not needed'
  157. DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
  158. NOSE_ARGS = ['--nocapture',
  159. '--nologcapture', ]