説明なし

settings.py 4.0KB

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