· 4 years ago · Apr 15, 2021, 01:24 PM
1"""
2Django settings for mysite project.
3
4Generated by 'django-admin startproject' using Django 3.1.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/3.1/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/3.1/ref/settings/
11"""
12
13from pathlib import Path
14
15# Build paths inside the project like this: BASE_DIR / 'subdir'.
16BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
17
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = '5nhf(mekz^+%#3e6*mm($0$$2hq2c8=xyc9+&!!+di%*b=axd_'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = []
29
30
31# Application definition
32
33INSTALLED_APPS = [
34 'polls.apps.PollsConfig',
35 'django.contrib.admin',
36 'django.contrib.auth',
37 'django.contrib.contenttypes',
38 'django.contrib.sessions',
39 'django.contrib.messages',
40 'django.contrib.staticfiles',
41 'mysite.apps.MysiteConfig',
42]
43
44MIDDLEWARE = [
45 'django.middleware.security.SecurityMiddleware',
46 'django.contrib.sessions.middleware.SessionMiddleware',
47 'django.middleware.common.CommonMiddleware',
48 'django.middleware.csrf.CsrfViewMiddleware',
49 'django.contrib.auth.middleware.AuthenticationMiddleware',
50 'django.contrib.messages.middleware.MessageMiddleware',
51 'django.middleware.clickjacking.XFrameOptionsMiddleware',
52]
53
54ROOT_URLCONF = 'mysite.urls'
55
56TEMPLATES = [
57 {
58 'BACKEND': 'django.template.backends.django.DjangoTemplates',
59 'DIRS': [BASE_DIR / "templates",],
60 'APP_DIRS': True,
61 'OPTIONS': {
62 'context_processors': [
63 'django.template.context_processors.debug',
64 'django.template.context_processors.request',
65 'django.contrib.auth.context_processors.auth',
66 'django.contrib.messages.context_processors.messages',
67 ],
68 },
69 },
70]
71
72WSGI_APPLICATION = 'mysite.wsgi.application'
73
74
75# Database
76# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
77
78DATABASES = {
79 'default': {
80 'ENGINE': 'django.db.backends.postgresql',
81 'NAME': 'postgres',
82 'USER': 'postgres',
83 'PASSWORD': '159266',
84 'HOST': '127.0.0.1',
85 'PORT': '5432',
86 }
87}
88
89
90# Password validation
91# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
92
93AUTH_PASSWORD_VALIDATORS = [
94 {
95 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
96 },
97 {
98 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
99 },
100 {
101 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
102 },
103 {
104 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
105 },
106]
107
108
109# Internationalization
110# https://docs.djangoproject.com/en/3.1/topics/i18n/
111
112LANGUAGE_CODE = 'en-us'
113
114TIME_ZONE = 'UTC'
115
116USE_I18N = True
117
118USE_L10N = True
119
120USE_TZ = True
121
122
123# Static files (CSS, JavaScript, Images)
124# https://docs.djangoproject.com/en/3.1/howto/static-files/
125
126STATIC_URL = '/static/'
127