base.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. """
  2. Django settings for temp project.
  3. Generated by 'django-admin startproject' using Django 1.10.5.
  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. import os
  10. # Build paths inside the project like this: os.path.join(PROJECT_DIR, ...)
  11. PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  12. BASE_DIR = os.path.dirname(PROJECT_DIR)
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = "c6u0-9c!7nilj_ysatsda0(f@e_2mws2f!6m0n^o*4#*q#kzp)"
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = []
  20. # Uncomment this (and adjust as appropriate) to enable django-debug-toolbar
  21. # INTERNAL_IPS = [
  22. # '127.0.0.1',
  23. # ]
  24. # Application definition
  25. INSTALLED_APPS = [
  26. "bakerydemo.base",
  27. "bakerydemo.blog",
  28. "bakerydemo.breads",
  29. "bakerydemo.locations",
  30. "bakerydemo.search",
  31. "wagtail.contrib.search_promotions",
  32. "wagtail.contrib.forms",
  33. "wagtail.contrib.redirects",
  34. "wagtail.embeds",
  35. "wagtail.sites",
  36. "wagtail.users",
  37. "wagtail.snippets",
  38. "wagtail.documents",
  39. "wagtail.images",
  40. "wagtail.search",
  41. "wagtail.admin",
  42. "wagtail.api.v2",
  43. "wagtail.locales",
  44. "wagtail.contrib.modeladmin",
  45. "wagtail.contrib.routable_page",
  46. "wagtail.contrib.simple_translation",
  47. "wagtail.contrib.styleguide",
  48. "wagtail",
  49. "rest_framework",
  50. "modelcluster",
  51. "taggit",
  52. "wagtailfontawesome",
  53. "wagtail_editable_help",
  54. "debug_toolbar",
  55. "django.contrib.admin",
  56. "django.contrib.auth",
  57. "django.contrib.contenttypes",
  58. "django.contrib.sessions",
  59. "django.contrib.messages",
  60. "django.contrib.staticfiles",
  61. "django.contrib.sitemaps",
  62. ]
  63. MIDDLEWARE = [
  64. "debug_toolbar.middleware.DebugToolbarMiddleware",
  65. "django.middleware.security.SecurityMiddleware",
  66. "django.contrib.sessions.middleware.SessionMiddleware",
  67. "django.middleware.common.CommonMiddleware",
  68. "django.middleware.csrf.CsrfViewMiddleware",
  69. "django.contrib.auth.middleware.AuthenticationMiddleware",
  70. "django.contrib.messages.middleware.MessageMiddleware",
  71. "django.middleware.clickjacking.XFrameOptionsMiddleware",
  72. "wagtail.contrib.redirects.middleware.RedirectMiddleware",
  73. ]
  74. DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
  75. ROOT_URLCONF = "bakerydemo.urls"
  76. TEMPLATES = [
  77. {
  78. "BACKEND": "django.template.backends.django.DjangoTemplates",
  79. "DIRS": [
  80. "bakerydemo/templates",
  81. ],
  82. "APP_DIRS": True,
  83. "OPTIONS": {
  84. "context_processors": [
  85. "django.template.context_processors.debug",
  86. "django.template.context_processors.request",
  87. "django.contrib.auth.context_processors.auth",
  88. "django.contrib.messages.context_processors.messages",
  89. ],
  90. },
  91. },
  92. ]
  93. WSGI_APPLICATION = "bakerydemo.wsgi.application"
  94. # Database
  95. # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  96. DATABASES = {
  97. "default": {
  98. "ENGINE": "django.db.backends.sqlite3",
  99. "NAME": os.path.join(BASE_DIR, "bakerydemodb"),
  100. }
  101. }
  102. # Password validation
  103. # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
  104. AUTH_PASSWORD_VALIDATORS = [
  105. {
  106. "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
  107. },
  108. {
  109. "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
  110. },
  111. {
  112. "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
  113. },
  114. {
  115. "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
  116. },
  117. ]
  118. # Internationalization
  119. # https://docs.djangoproject.com/en/3.2/topics/i18n/
  120. LANGUAGE_CODE = "en-us"
  121. TIME_ZONE = "UTC"
  122. USE_I18N = True
  123. USE_L10N = True
  124. USE_TZ = True
  125. # Static files (CSS, JavaScript, Images)
  126. # https://docs.djangoproject.com/en/3.2/howto/static-files/
  127. STATICFILES_FINDERS = [
  128. "django.contrib.staticfiles.finders.FileSystemFinder",
  129. "django.contrib.staticfiles.finders.AppDirectoriesFinder",
  130. ]
  131. STATICFILES_DIRS = [
  132. os.path.join(PROJECT_DIR, "static"),
  133. ]
  134. STATIC_ROOT = os.path.join(PROJECT_DIR, "collect_static")
  135. STATIC_URL = "/static/"
  136. MEDIA_ROOT = os.path.join(PROJECT_DIR, "media")
  137. MEDIA_URL = "/media/"
  138. # Override in local settings or replace with your own key. Please don't use our demo key in production!
  139. GOOGLE_MAP_API_KEY = "AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw"
  140. # Use Elasticsearch as the search backend for extra performance and better search results
  141. WAGTAILSEARCH_BACKENDS = {
  142. "default": {
  143. "BACKEND": "wagtail.search.backends.database",
  144. "INDEX": "bakerydemo",
  145. },
  146. }
  147. # Wagtail settings
  148. WAGTAIL_SITE_NAME = "bakerydemo"
  149. WAGTAIL_I18N_ENABLED = True
  150. WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [
  151. ("en", "English"),
  152. ("de", "Deutsch"),
  153. ("ar", "العربيّة"),
  154. ]