base.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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/1.10/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.10/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/1.10/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. # Application definition
  21. INSTALLED_APPS = [
  22. 'bakerydemo.base',
  23. 'bakerydemo.blog',
  24. 'bakerydemo.breads',
  25. 'bakerydemo.locations',
  26. 'bakerydemo.search',
  27. 'wagtail.contrib.legacy.richtext',
  28. 'wagtail.contrib.search_promotions',
  29. 'wagtail.contrib.forms',
  30. 'wagtail.contrib.redirects',
  31. 'wagtail.embeds',
  32. 'wagtail.sites',
  33. 'wagtail.users',
  34. 'wagtail.snippets',
  35. 'wagtail.documents',
  36. 'wagtail.images',
  37. 'wagtail.search',
  38. 'wagtail.admin',
  39. 'wagtail.api.v2',
  40. 'wagtail.contrib.modeladmin',
  41. 'wagtail.contrib.routable_page',
  42. 'wagtail.core',
  43. 'rest_framework',
  44. 'modelcluster',
  45. 'taggit',
  46. 'wagtailfontawesome',
  47. 'django.contrib.admin',
  48. 'django.contrib.auth',
  49. 'django.contrib.contenttypes',
  50. 'django.contrib.sessions',
  51. 'django.contrib.messages',
  52. 'django.contrib.staticfiles',
  53. 'django.contrib.sitemaps',
  54. ]
  55. MIDDLEWARE = [
  56. 'django.middleware.security.SecurityMiddleware',
  57. 'django.contrib.sessions.middleware.SessionMiddleware',
  58. 'django.middleware.common.CommonMiddleware',
  59. 'django.middleware.csrf.CsrfViewMiddleware',
  60. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  61. 'django.contrib.messages.middleware.MessageMiddleware',
  62. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  63. 'wagtail.contrib.redirects.middleware.RedirectMiddleware',
  64. ]
  65. ROOT_URLCONF = 'bakerydemo.urls'
  66. TEMPLATES = [
  67. {
  68. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  69. 'DIRS': ['bakerydemo/templates', ],
  70. 'APP_DIRS': True,
  71. 'OPTIONS': {
  72. 'context_processors': [
  73. 'django.template.context_processors.debug',
  74. 'django.template.context_processors.request',
  75. 'django.contrib.auth.context_processors.auth',
  76. 'django.contrib.messages.context_processors.messages',
  77. ],
  78. },
  79. },
  80. ]
  81. WSGI_APPLICATION = 'bakerydemo.wsgi.application'
  82. # Database
  83. # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
  84. DATABASES = {
  85. 'default': {
  86. 'ENGINE': 'django.db.backends.sqlite3',
  87. 'NAME': os.path.join(BASE_DIR, 'bakerydemodb')
  88. }
  89. }
  90. # Password validation
  91. # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
  92. AUTH_PASSWORD_VALIDATORS = [
  93. {
  94. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  95. },
  96. {
  97. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  98. },
  99. {
  100. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  101. },
  102. {
  103. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  104. },
  105. ]
  106. # Internationalization
  107. # https://docs.djangoproject.com/en/1.10/topics/i18n/
  108. LANGUAGE_CODE = 'en-us'
  109. TIME_ZONE = 'UTC'
  110. USE_I18N = True
  111. USE_L10N = True
  112. USE_TZ = True
  113. # Static files (CSS, JavaScript, Images)
  114. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  115. STATICFILES_FINDERS = [
  116. 'django.contrib.staticfiles.finders.FileSystemFinder',
  117. 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  118. ]
  119. STATICFILES_DIRS = [
  120. os.path.join(PROJECT_DIR, 'static'),
  121. ]
  122. STATIC_ROOT = os.path.join(PROJECT_DIR, 'collect_static')
  123. STATIC_URL = '/static/'
  124. MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
  125. MEDIA_URL = '/media/'
  126. # Override in local settings or replace with your own key. Please don't use our demo key in production!
  127. GOOGLE_MAP_API_KEY = 'AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw'
  128. # Use Elasticsearch as the search backend for extra performance and better search results
  129. WAGTAILSEARCH_BACKENDS = {
  130. 'default': {
  131. 'BACKEND': 'wagtail.search.backends.db',
  132. 'INDEX': 'bakerydemo',
  133. },
  134. }
  135. # Wagtail settings
  136. WAGTAIL_SITE_NAME = "bakerydemo"