Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.52 KB | None | 0 0
  1. """
  2. Django settings for mountain_weather project.
  3.  
  4. Generated by 'django-admin startproject' using Django 3.0.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/3.0/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/3.0/ref/settings/
  11. """
  12.  
  13. import os
  14.  
  15. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  16. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  17. TEMPLATES_DIR = os.path.join(BASE_DIR,'templates')
  18. STATICFILES_DIR = os.path.join(BASE_DIR,'static')
  19.  
  20.  
  21. # Quick-start development settings - unsuitable for production
  22. # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
  23.  
  24. # SECURITY WARNING: keep the secret key used in production secret!
  25. SECRET_KEY = 'k)e@vzmeyd6kev^@x#sj2y(0y!sd83*v)x%-i*(k7q@_bdovpz'
  26.  
  27. # SECURITY WARNING: don't run with debug turned on in production!
  28. DEBUG = True
  29.  
  30. ALLOWED_HOSTS = []
  31.  
  32.  
  33. # Application definition
  34.  
  35. INSTALLED_APPS = [
  36.     'django.contrib.admin',
  37.     'django.contrib.auth',
  38.     'django.contrib.contenttypes',
  39.     'django.contrib.sessions',
  40.     'django.contrib.messages',
  41.     'django.contrib.staticfiles',
  42.     'zakopane_weather',
  43.     'django_cron'
  44. ]
  45.  
  46. MIDDLEWARE = [
  47.     'django.middleware.security.SecurityMiddleware',
  48.     'django.contrib.sessions.middleware.SessionMiddleware',
  49.     'django.middleware.common.CommonMiddleware',
  50.     'django.middleware.csrf.CsrfViewMiddleware',
  51.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  52.     'django.contrib.messages.middleware.MessageMiddleware',
  53.     'django.middleware.clickjacking.XFrameOptionsMiddleware',
  54. ]
  55.  
  56. CRON_CLASSES = [
  57.     'zakopane_weather.cron.MyCronJob',
  58. ]
  59.  
  60. ROOT_URLCONF = 'mountain_weather.urls'
  61.  
  62. TEMPLATES = [
  63.     {
  64.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  65.         'DIRS': [TEMPLATES_DIR],
  66.         'APP_DIRS': True,
  67.         'OPTIONS': {
  68.             'context_processors': [
  69.                 'django.template.context_processors.debug',
  70.                 'django.template.context_processors.request',
  71.                 'django.contrib.auth.context_processors.auth',
  72.                 'django.contrib.messages.context_processors.messages',
  73.             ],
  74.         },
  75.     },
  76. ]
  77.  
  78. WSGI_APPLICATION = 'mountain_weather.wsgi.application'
  79.  
  80.  
  81. # Database
  82. # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
  83.  
  84. DATABASES = {
  85.     'default': {
  86.         'ENGINE': 'django.db.backends.postgresql_psycopg2',
  87.         'NAME': os.environ.get('DB_NAME'),
  88.         'USER': os.environ.get('DB_USER'),
  89.         'PASSWORD': os.environ.get('DB_PASS'),
  90.         'HOST':'localhost',
  91.         'PORT':'5432',
  92.     }
  93. }
  94.  
  95.  
  96. # Password validation
  97. # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
  98.  
  99. AUTH_PASSWORD_VALIDATORS = [
  100.     {
  101.         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  102.     },
  103.     {
  104.         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  105.     },
  106.     {
  107.         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  108.     },
  109.     {
  110.         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  111.     },
  112. ]
  113.  
  114.  
  115. # Internationalization
  116. # https://docs.djangoproject.com/en/3.0/topics/i18n/
  117.  
  118. LANGUAGE_CODE = 'en-us'
  119.  
  120. TIME_ZONE = 'UTC'
  121.  
  122. USE_I18N = True
  123.  
  124. USE_L10N = True
  125.  
  126. USE_TZ = True
  127.  
  128.  
  129. # Static files (CSS, JavaScript, Images)
  130. # https://docs.djangoproject.com/en/3.0/howto/static-files/
  131.  
  132. STATIC_URL = '/static/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement