Nav apraksta

settings.py 4.0KB

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