Advertisement
ugrobug

Untitled

Jul 14th, 2022
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.86 KB | None | 0 0
  1. """
  2. Django settings for wherefilmed project.
  3.  
  4. Generated by 'django-admin startproject' using Django 4.0.4.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/4.0/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/4.0/ref/settings/
  11. """
  12.  
  13. from pathlib import Path
  14. import os
  15.  
  16. # Build paths inside the project like this: BASE_DIR / 'subdir'.
  17. BASE_DIR = Path(__file__).resolve().parent.parent
  18.  
  19. # Application definition
  20. INSTALLED_APPS = [
  21.     'main',
  22.     'movies',
  23.     'django.contrib.admin',
  24.     'django.contrib.auth',
  25.     'django.contrib.contenttypes',
  26.     'django.contrib.sessions',
  27.     'django.contrib.messages',
  28.     'django.contrib.staticfiles',
  29.     'debug_toolbar',
  30.     'django_webp',
  31.     'django.contrib.sitemaps',
  32.     'sorl.thumbnail',
  33. ]
  34.  
  35. # SECURITY WARNING: keep the secret key used in production secret!
  36. SECRET_KEY = ('BmzgfaiiV4mIAitzWOxkkO4fTDl5MXlixMLUQkU6bhmaxNeLYvQOS7OkDsidZiND')
  37. CSRF_COOKIE_SECURE = True
  38. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  39. USE_X_FORWARDED_HOST = True
  40. USE_X_FORWARDED_PORT = True
  41. DEBUG = False
  42. SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
  43. SECURE_CONTENT_TYPE_NOSNIFF = True
  44. SECURE_SSL_HOST = True
  45. SECURE_HSTS_SECONDS = 60
  46. SECURE_HSTS_INCLUDE_SUBDOMAINS = True
  47. SECURE_HSTS_PRELOAD = True
  48. X_FRAME_OPTIONS = "SAMEORIGIN"
  49.  
  50. ALLOWED_HOSTS = ['wherefilmed.org', 'localhost']
  51.  
  52.  
  53.  
  54. MIDDLEWARE = [
  55.     'django.middleware.security.SecurityMiddleware',
  56.     'django.contrib.sessions.middleware.SessionMiddleware',
  57.     'django.middleware.common.CommonMiddleware',
  58.     'django.middleware.csrf.CsrfViewMiddleware',
  59.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  60.     'django.contrib.messages.middleware.MessageMiddleware',
  61.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  62.     'debug_toolbar.middleware.DebugToolbarMiddleware',
  63. ]
  64.  
  65.  
  66.  
  67. ROOT_URLCONF = 'wherefilmed.urls'
  68.  
  69.                 'django.template.context_processors.request',
  70.                 'django.contrib.auth.context_processors.auth',
  71.                 'django.contrib.messages.context_processors.messages',
  72.                 'django_webp.context_processors.webp',
  73.             ],
  74.         },
  75.     },
  76. ]
  77.  
  78. WSGI_APPLICATION = 'wherefilmed.wsgi.application'
  79.  
  80. # Database
  81. # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
  82.  
  83. DATABASES = {
  84.     'default': {
  85.         'ENGINE': 'django.db.backends.postgresql_psycopg2',
  86.         'NAME': 'wherefilmed',
  87.         'USER': 'ugrobug',
  88.         'PASSWORD': 'Mkm695nbv45fa8phg',
  89.         'HOST': 'localhost',
  90.         'PORT':'',
  91.     }
  92. }
  93.  
  94. # Password validation
  95. # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
  96.  
  97.  
  98. AUTH_PASSWORD_VALIDATORS = [
  99.     {
  100.         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  101.     },
  102.     {
  103.         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  104.     },
  105.     {
  106.         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  107.     },
  108.     {
  109.         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  110.     },
  111. ]
  112.  
  113.  
  114. # Internationalization
  115. # https://docs.djangoproject.com/en/4.0/topics/i18n/
  116.  
  117. LANGUAGE_CODE = 'en'
  118.  
  119. TIME_ZONE = 'UTC'
  120.  
  121. USE_I18N = True
  122.  
  123. USE_TZ = True
  124.  
  125. # Static files (CSS, JavaScript, Images)
  126. # https://docs.djangoproject.com/en/4.0/howto/static-files/
  127.  
  128. STATIC_URL = '/static/'
  129. STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
  130.  
  131. MEDIA_URL = '/media/'
  132. MEDIA_ROOT = BASE_DIR / 'media'
  133. # Default primary key field type
  134. # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
  135.  
  136. DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  137.  
  138. INTERNAL_IPS = ["127.0.0.1"]
  139.  
  140.  
  141. # CORS_ORIGIN_WHITELIST = [
  142. #     'http://localhost:8080',
  143. #     'http://localhost:8081',
  144. #     'http://localhost:8000'
  145. # ]
  146.  
  147.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement