Brak opisu

settings.py 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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.contrib.admin',
  38. 'django.contrib.auth',
  39. 'django.contrib.contenttypes',
  40. 'django.contrib.sessions',
  41. 'django.contrib.messages',
  42. 'import_export',
  43. 'django_quill',
  44. 'crispy_forms',
  45. 'taggit',
  46. 'backend.apps.BackendConfig',
  47. 'fruit.apps.FruitConfig',
  48. 'cms.apps.CmsConfig',
  49. 'front.apps.FrontConfig',
  50. ]
  51. MIDDLEWARE = [
  52. 'django.middleware.security.SecurityMiddleware',
  53. 'django.contrib.sessions.middleware.SessionMiddleware',
  54. 'django.middleware.common.CommonMiddleware',
  55. 'django.middleware.csrf.CsrfViewMiddleware',
  56. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  57. 'django.contrib.messages.middleware.MessageMiddleware',
  58. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  59. ]
  60. ROOT_URLCONF = 'shaqfindbed.urls'
  61. TEMPLATES = [
  62. {
  63. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  64. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  65. 'APP_DIRS': True,
  66. 'OPTIONS': {
  67. 'context_processors': [
  68. 'django.template.context_processors.debug',
  69. 'django.template.context_processors.request',
  70. 'django.contrib.auth.context_processors.auth',
  71. 'django.contrib.messages.context_processors.messages',
  72. ],
  73. },
  74. },
  75. ]
  76. WSGI_APPLICATION = 'shaqfindbed.wsgi.application'
  77. # Database
  78. # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
  79. DATABASES = {
  80. 'default': {
  81. 'ENGINE': 'django.contrib.gis.db.backends.postgis',
  82. 'NAME': 'postgres',
  83. 'USER': 'postgres',
  84. 'PASSWORD': 'postgres',
  85. 'HOST': 'db',
  86. 'PORT': 5432,
  87. }
  88. }
  89. # Password validation
  90. # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
  91. AUTH_PASSWORD_VALIDATORS = [
  92. {
  93. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  94. },
  95. {
  96. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  97. },
  98. {
  99. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  100. },
  101. {
  102. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  103. },
  104. ]
  105. # Internationalization
  106. # https://docs.djangoproject.com/en/3.2/topics/i18n/
  107. LANGUAGE_CODE = 'en-us'
  108. #TIME_ZONE = 'UTC'
  109. TIME_ZONE = 'Asia/Bangkok'
  110. USE_I18N = True
  111. USE_L10N = True
  112. USE_TZ = True
  113. # Static files (CSS, JavaScript, Images)
  114. # https://docs.djangoproject.com/en/3.2/howto/static-files/
  115. STATIC_URL = '/static/'
  116. STATIC_ROOT = os.path.join(BASE_DIR, "staticfile")
  117. STATICFILES_DIRS = [
  118. os.path.join(BASE_DIR, "static"),
  119. #os.path.join(BASE_DIR, "bower_components"),
  120. ]
  121. # Default primary key field type
  122. # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
  123. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  124. GOOGLE_MAPS_API_KEY = 'AIzaSyDX92c5HOH7uhQ4reo8aE4-40bR_G-GMU4'
  125. MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  126. MEDIA_URL = '/media/'
  127. #JQUERY_URL = True
  128. USE_DJANGO_JQUERY = True
  129. LOGIN_REDIRECT_URL = '/fruit/mystore'
  130. LOGIN_URL = '/login'
  131. CRISPY_TEMPLATE_PACK = "bootstrap4"