· 7 years ago · Mar 18, 2018, 05:56 PM
1"""
2Django settings for CompetitionRegistry project.
3
4Generated by 'django-admin startproject' using Django 1.11.8.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.11/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.11/ref/settings/
11"""
12
13import os
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18# Quick-start development settings - unsuitable for production
19# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
20
21# SECURITY WARNING: keep the secret key used in production secret!
22SECRET_KEY = '#5tsr@xcsmy1ie+!z47kq+v&=u=2q4t($7sl+8^8g*8!$3b1qa'
23
24ALLOWED_HOSTS = []
25
26# Application definition
27
28INSTALLED_APPS = [
29 'jet.dashboard',
30 'jet',
31 # 'admin_tools',
32 # 'admin_tools.theming',
33 # 'admin_tools.menu',
34 # 'admin_tools.dashboard',
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 'registry',
43 'geo'
44]
45
46MIDDLEWARE = [
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
56ROOT_URLCONF = 'CompetitionRegistry.urls'
57
58TEMPLATES = [
59 {
60 'BACKEND': 'django.template.backends.django.DjangoTemplates',
61 'DIRS': [os.path.join(BASE_DIR, 'templates')],
62 'OPTIONS': {
63 'context_processors': [
64 'django.template.context_processors.debug',
65 'django.template.context_processors.request',
66 'django.contrib.auth.context_processors.auth',
67 'django.contrib.messages.context_processors.messages',
68 ],
69 'loaders': [
70 'admin_tools.template_loaders.Loader',
71 'django.template.loaders.filesystem.Loader',
72 'django.template.loaders.app_directories.Loader'
73 ],
74 },
75 },
76]
77
78WSGI_APPLICATION = 'CompetitionRegistry.wsgi.application'
79
80# Database
81# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
82
83DATABASES = {
84 'default': {
85 'ENGINE': 'django.db.backends.sqlite3',
86 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
87 }
88}
89
90# Password validation
91# https://docs.djangoproject.com/en/1.11/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# Internationalization
109# https://docs.djangoproject.com/en/1.11/topics/i18n/
110
111LANGUAGE_CODE = 'ru-ru'
112
113TIME_ZONE = 'Europe/Moscow'
114
115USE_I18N = True
116
117USE_L10N = True
118
119USE_TZ = True
120
121# JET
122JET_INDEX_DASHBOARD = 'CompetitionRegistry.dashboard.CustomIndexDashboard'
123JET_SIDE_MENU_COMPACT = True
124JET_SIDE_MENU_ITEMS = [
125 {'label': 'Учет', 'items': [
126 {'name': 'registry.company'},
127 {'name': 'registry.competition'},
128 {'name': 'registry.responsible'}
129 ]},
130 {'label': 'Учет (архив)', 'items': [
131 {'name': 'registry.competitionhistory'},
132 {'name': 'registry.companyhistory'},
133 ]},
134 {'label': 'ДеÑтельноÑть', 'items': [
135 {'name': 'registry.categorykindofwork'},
136 {'name': 'registry.kindofwork'},
137 ]},
138 {'label': 'МеÑтоположение', 'items': [
139 {'name': 'geo.city'},
140 {'name': 'geo.region'},
141 ]},
142 {'label': 'Лицензии', 'items': [
143 {'name': 'registry.licensesro'},
144 {'name': 'registry.licensesroi'},
145 {'name': 'registry.licensesrop'},
146 {'name': 'registry.licensemchs'},
147 {'name': 'registry.licensertntw'},
148 {'name': 'registry.licensertnka'},
149 {'name': 'registry.licenseminkult'}
150 ]},
151]
152
153# Static files (CSS, JavaScript, Images)
154# https://docs.djangoproject.com/en/1.11/howto/static-files/
155
156STATICFILES_FINDERS = (
157 'django.contrib.staticfiles.finders.FileSystemFinder',
158 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
159)
160
161STATICFILES_DIRS = [
162 os.path.join(BASE_DIR, "static"),
163]
164
165STATIC_URL = '/static/'