base.py 4.6 KB

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