|
| 1 | +""" |
| 2 | +Django settings for beer_analytics project. |
| 3 | +
|
| 4 | +Generated by 'django-admin startproject' using Django 3.1. |
| 5 | +
|
| 6 | +For more information on this file, see |
| 7 | +https://docs.djangoproject.com/en/3.1/topics/settings/ |
| 8 | +
|
| 9 | +For the full list of settings and their values, see |
| 10 | +https://docs.djangoproject.com/en/3.1/ref/settings/ |
| 11 | +""" |
| 12 | + |
| 13 | +from pathlib import Path |
| 14 | + |
| 15 | +import environ |
| 16 | + |
| 17 | +env = environ.Env( |
| 18 | + # set casting, default value |
| 19 | + DEBUG=(bool, False) |
| 20 | +) |
| 21 | + |
| 22 | +# reading .env file |
| 23 | +environ.Env.read_env() |
| 24 | + |
| 25 | +# Build paths inside the project like this: BASE_DIR / 'subdir'. |
| 26 | +BASE_DIR = Path(__file__).resolve(strict=True).parent.parent |
| 27 | + |
| 28 | + |
| 29 | +# Quick-start development settings - unsuitable for production |
| 30 | +# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ |
| 31 | + |
| 32 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 33 | +SECRET_KEY = env('SECRET_KEY') |
| 34 | + |
| 35 | +# SECURITY WARNING: don't run with debug turned on in production! |
| 36 | +DEBUG = env('DEBUG') |
| 37 | + |
| 38 | +ALLOWED_HOSTS = [] |
| 39 | + |
| 40 | + |
| 41 | +# Application definition |
| 42 | + |
| 43 | + |
| 44 | +INSTALLED_APPS = [ |
| 45 | + 'django.contrib.contenttypes', |
| 46 | + 'django.contrib.staticfiles', |
| 47 | +] |
| 48 | + |
| 49 | +MIDDLEWARE = [ |
| 50 | + 'django.middleware.security.SecurityMiddleware', |
| 51 | + 'django.middleware.common.CommonMiddleware', |
| 52 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 53 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 54 | +] |
| 55 | + |
| 56 | +ROOT_URLCONF = 'beer_analytics.urls' |
| 57 | + |
| 58 | +TEMPLATES = [ |
| 59 | + { |
| 60 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 61 | + 'DIRS': [], |
| 62 | + 'APP_DIRS': True, |
| 63 | + 'OPTIONS': { |
| 64 | + 'context_processors': [ |
| 65 | + 'django.template.context_processors.debug', |
| 66 | + 'django.template.context_processors.request', |
| 67 | + 'django.contrib.auth.context_processors.auth', |
| 68 | + 'django.contrib.messages.context_processors.messages', |
| 69 | + ], |
| 70 | + }, |
| 71 | + }, |
| 72 | +] |
| 73 | + |
| 74 | +WSGI_APPLICATION = 'beer_analytics.wsgi.application' |
| 75 | + |
| 76 | + |
| 77 | +# Database |
| 78 | +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases |
| 79 | + |
| 80 | +DATABASES = { |
| 81 | + 'default': { |
| 82 | + 'ENGINE': 'django.db.backends.sqlite3', |
| 83 | + 'NAME': BASE_DIR / 'var/data.sqlite3', |
| 84 | + } |
| 85 | +} |
| 86 | + |
| 87 | + |
| 88 | +# Internationalization |
| 89 | +# https://docs.djangoproject.com/en/3.1/topics/i18n/ |
| 90 | + |
| 91 | +LANGUAGE_CODE = 'en-us' |
| 92 | +TIME_ZONE = 'UTC' |
| 93 | +USE_I18N = True |
| 94 | +USE_L10N = True |
| 95 | +USE_TZ = True |
| 96 | + |
| 97 | + |
| 98 | +# Static files (CSS, JavaScript, Images) |
| 99 | +# https://docs.djangoproject.com/en/3.1/howto/static-files/ |
| 100 | + |
| 101 | +STATIC_URL = '/static/' |
0 commit comments