暫無描述

settings.py 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. """
  2. Django settings for shaqfindbed project.
  3. Generated by 'django-admin startproject' using Django 3.2.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. from pathlib import Path
  10. import os
  11. from django.conf import settings
  12. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  13. BASE_DIR = Path(__file__).resolve().parent.parent
  14. # Quick-start development settings - unsuitable for production
  15. # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
  16. # SECURITY WARNING: keep the secret key used in production secret!
  17. SECRET_KEY = 'django-insecure-!=!d6rsewcddw=hr-j46#))^nd-32(kkjmnpxxioi(v&c9!*xn'
  18. # SECURITY WARNING: don't run with debug turned on in production!
  19. DEBUG = True
  20. ALLOWED_HOSTS = [
  21. "167.71.218.44",
  22. "localhost",
  23. '.findbed.xyz'
  24. ]
  25. # Application definition
  26. INSTALLED_APPS = [
  27. "sslserver",
  28. 'django.contrib.staticfiles',
  29. 'django.contrib.gis',
  30. 'smart_selects',
  31. 'colorfield',
  32. 'django_json_widget',
  33. 'dal',
  34. 'dal_select2',
  35. 'mptt',
  36. 'django_google_maps',
  37. 'django_bootstrap_breadcrumbs',
  38. 'django.contrib.admin',
  39. 'django.contrib.auth',
  40. 'django.contrib.contenttypes',
  41. 'django.contrib.sessions',
  42. 'django.contrib.messages',
  43. 'import_export',
  44. 'django_filters',
  45. 'django_quill',
  46. 'crispy_forms',
  47. 'taggit',
  48. 'backend.apps.BackendConfig',
  49. 'fruit.apps.FruitConfig',
  50. 'cms.apps.CmsConfig',
  51. 'front.apps.FrontConfig',
  52. ]
  53. MIDDLEWARE = [
  54. 'django.middleware.security.SecurityMiddleware',
  55. 'django.contrib.sessions.middleware.SessionMiddleware',
  56. 'django.middleware.common.CommonMiddleware',
  57. 'django.middleware.csrf.CsrfViewMiddleware',
  58. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  59. 'django.contrib.messages.middleware.MessageMiddleware',
  60. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  61. ]
  62. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  63. EMAIL_HOST = 'smtp.gmail.com'
  64. EMAIL_HOST_USER = 'tech@simplico.net'
  65. EMAIL_HOST_PASSWORD = 'SteveJobs1984'
  66. EMAIL_PORT = 587
  67. EMAIL_USE_TLS = True
  68. DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
  69. ROOT_URLCONF = 'shaqfindbed.urls'
  70. TEMPLATES = [
  71. {
  72. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  73. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  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. ],
  82. },
  83. },
  84. ]
  85. WSGI_APPLICATION = 'shaqfindbed.wsgi.application'
  86. # Database
  87. # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  88. DATABASES = {
  89. 'default': {
  90. 'ENGINE': 'django.contrib.gis.db.backends.postgis',
  91. 'NAME': 'postgres',
  92. 'USER': 'postgres',
  93. 'PASSWORD': 'postgres',
  94. 'HOST': 'db',
  95. 'PORT': 5432,
  96. }
  97. }
  98. # Password validation
  99. # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
  100. AUTH_PASSWORD_VALIDATORS = [
  101. {
  102. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  103. },
  104. {
  105. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  106. },
  107. {
  108. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  109. },
  110. {
  111. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  112. },
  113. ]
  114. # Internationalization
  115. # https://docs.djangoproject.com/en/3.2/topics/i18n/
  116. LANGUAGE_CODE = 'en-us'
  117. #TIME_ZONE = 'UTC'
  118. TIME_ZONE = 'Asia/Bangkok'
  119. USE_I18N = True
  120. USE_L10N = True
  121. USE_TZ = True
  122. # Static files (CSS, JavaScript, Images)
  123. # https://docs.djangoproject.com/en/3.2/howto/static-files/
  124. STATIC_URL = '/static/'
  125. STATIC_ROOT = os.path.join(BASE_DIR, "staticfile")
  126. STATICFILES_DIRS = [
  127. os.path.join(BASE_DIR, "static"),
  128. #os.path.join(BASE_DIR, "bower_components"),
  129. ]
  130. # Default primary key field type
  131. # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
  132. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  133. GOOGLE_MAPS_API_KEY = 'AIzaSyDX92c5HOH7uhQ4reo8aE4-40bR_G-GMU4'
  134. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  135. MEDIA_URL = '/media/'
  136. #JQUERY_URL = True
  137. USE_DJANGO_JQUERY = True
  138. LOGIN_REDIRECT_URL = '/fruit/mystore'
  139. LOGIN_URL = '/login'
  140. CRISPY_TEMPLATE_PACK = "bootstrap4"
  141. BREADCRUMBS_TEMPLATE = "django_bootstrap_breadcrumbs/bootstrap4.html"