· 4 years ago · Nov 17, 2020, 02:18 AM
1"""
2Django settings for RAPODjango project.
3
4Based on 'django-admin startproject' using Django 2.1.2.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/2.1/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/2.1/ref/settings/
11"""
12
13import os
14import posixpath
15
16# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = 'd42f1afc-ff63-45c5-8a35-17c091a3c6d2'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = ['*']
29
30# Application references
31# https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-INSTALLED_APPS
32INSTALLED_APPS = [
33 'app',
34 # Add your apps here to enable them
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]
42
43# Middleware framework
44# https://docs.djangoproject.com/en/2.1/topics/http/middleware/
45MIDDLEWARE = [
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
55ROOT_URLCONF = 'RAPODjango.urls'
56
57# Template configuration
58# https://docs.djangoproject.com/en/2.1/topics/templates/
59TEMPLATES = [
60 {
61 'BACKEND': 'django.template.backends.django.DjangoTemplates',
62 'DIRS': [],
63 'APP_DIRS': True,
64 'OPTIONS': {
65 'context_processors': [
66 'django.template.context_processors.debug',
67 'django.template.context_processors.request',
68 'django.contrib.auth.context_processors.auth',
69 'django.contrib.messages.context_processors.messages',
70 ],
71 },
72 },
73]
74
75WSGI_APPLICATION = 'RAPODjango.wsgi.application'
76# Database
77# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
78DATABASES = {
79 'default': {
80 'ENGINE': 'django.db.backends.sqlite3',
81 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
82 }
83}
84
85# Password validation
86# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
87AUTH_PASSWORD_VALIDATORS = [
88 {
89 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90 },
91 {
92 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93 },
94 {
95 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96 },
97 {
98 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99 },
100]
101
102# Internationalization
103# https://docs.djangoproject.com/en/2.1/topics/i18n/
104LANGUAGE_CODE = 'ru-ru'
105TIME_ZONE = 'Asia/Irkutsk'
106USE_I18N = True
107USE_L10N = True
108USE_TZ = True
109
110# Static files (CSS, JavaScript, Images)
111# https://docs.djangoproject.com/en/2.1/howto/static-files/
112STATIC_URL = '/static/'
113STATIC_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['static']))
114MEDIA_ROOT = posixpath.join(*(BASE_DIR.split(os.path.sep) + ['media']))
115