· 8 years ago · Jun 07, 2017, 07:40 AM
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# ~ Author: Pavel Ivanov
4# ~ Date: Ðпрель 2016
5
6"""
7Django settings for zdkvartira project.
8
9Generated by 'django-admin startproject' using Django 1.9.4.
10
11For more information on this file, see
12https://docs.djangoproject.com/en/1.9/topics/settings/
13
14For the full list of settings and their values, see
15https://docs.djangoproject.com/en/1.9/ref/settings/
16"""
17
18import os
19
20# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
21BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
22
23
24# Quick-start development settings - unsuitable for production
25# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
26
27# SECURITY WARNING: keep the secret key used in production secret!
28SECRET_KEY = 'xhp%q0vvexvsv58lz)a8e#-g77g232kkonz6turp2q+1q(lc(9'
29
30# SECURITY WARNING: don't run with debug turned on in production!
31DEBUG = True
32
33ALLOWED_HOSTS = ['zdkvartira.ru', 'www.zdkvartira.ru', 'dev.zdkvartira.ru', 'www.dev.zdkvartira.ru', 'dev1.zdkvartira.ru', 'localhost']
34
35
36
37# Application definition
38
39INSTALLED_APPS = [
40 'django.contrib.admin',
41 'django.contrib.auth',
42 'django.contrib.contenttypes',
43 'django.contrib.sessions',
44 'django.contrib.messages',
45 'django.contrib.staticfiles',
46 'news',
47 'newly',
48 'staff',
49 'secondaryflats',
50 'reviews',
51 'webforms',
52 'pages',
53 'remont'
54]
55
56MIDDLEWARE_CLASSES = [
57 'django.middleware.security.SecurityMiddleware',
58 'django.contrib.sessions.middleware.SessionMiddleware',
59 'django.middleware.common.CommonMiddleware',
60 'django.middleware.csrf.CsrfViewMiddleware',
61 'django.contrib.auth.middleware.AuthenticationMiddleware',
62 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
63 'django.contrib.messages.middleware.MessageMiddleware',
64 'django.middleware.clickjacking.XFrameOptionsMiddleware',
65]
66
67if DEBUG:
68 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
69else:
70 EMAIL_HOST = 'localhost'
71 EMAIL_PORT = 25
72 EMAIL_HOST_USER = ''
73 EMAIL_HOST_PASSWORD = ''
74 EMAIL_USE_TLS = False
75
76MAIL_RECIPIENTS = [
77 'pablodiguerero@gmail.com',
78 'p.ivanov@it-lab.su',
79 'igorpalatov@mail.ru'
80]
81
82ROOT_URLCONF = 'zdkvartira.urls'
83
84TEMPLATES = [
85 {
86 'BACKEND': 'django.template.backends.django.DjangoTemplates',
87 'DIRS': [os.path.join(BASE_DIR, 'templates')],
88 'APP_DIRS': True,
89 'OPTIONS': {
90 'context_processors': [
91 'django.template.context_processors.debug',
92 'django.template.context_processors.request',
93 'django.contrib.auth.context_processors.auth',
94 'django.contrib.messages.context_processors.messages',
95 ],
96 },
97 },
98]
99
100WSGI_APPLICATION = 'zdkvartira.wsgi.application'
101
102# Database
103# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
104
105DATABASES = {
106 'default': {
107 'ENGINE': 'django.db.backends.postgresql_psycopg2',
108 'NAME': 'dev_zdkvartira',
109 'USER': 'dev_zdkvartira',
110 'PASSWORD': 'cKq${kUW',
111 'HOST': '46.36.221.104',
112 'PORT': '',
113 }
114}
115
116CACHES = {
117 'default': {
118 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
119 'LOCATION': 'unique-snowflake',
120 'TIMEOUT': 10
121 }
122}
123
124# Password validation
125# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
126
127AUTH_PASSWORD_VALIDATORS = [
128 {
129 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
130 },
131 {
132 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
133 },
134 {
135 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
136 },
137 {
138 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
139 },
140]
141
142
143# Internationalization
144# https://docs.djangoproject.com/en/1.9/topics/i18n/
145
146LANGUAGE_CODE = 'ru'
147
148TIME_ZONE = 'UTC'
149
150USE_I18N = True
151
152USE_L10N = True
153
154USE_TZ = True
155
156# Static files (CSS, JavaScript, Images)
157# https://docs.djangoproject.com/en/1.9/howto/static-files/
158
159STATICFILES_DIRS = (
160 os.path.join(BASE_DIR, 'static'),
161)
162
163if DEBUG:
164 STATIC_URL = '/static/'
165 MEDIA_URL = '/static/uploads/'
166else:
167 STATIC_URL = '/static/'
168 MEDIA_URL = '/media/'
169
170CRM_URL_EXPORT_SALE = "http://5.45.121.35/work/exp/files/SITE/db.xml"
171CRM_URL_EXPORT_RENT = "http://5.45.121.35/work/exp/files/SITE/db2.xml"
172CRM_URL_NEWS = "http://miel.vznode.ru/news.xml"
173CRM_URL_PHRASE = "http://miel.vznode.ru/phrase.xml"
174CRM_URL_PRESS = "http://miel.vznode.ru/press.xml"
175CRM_URL_ANALYTICS = "http://miel.vznode.ru/analytics.xml"
176
177SPHINX_DB = 'dev_zdkvartira'
178
179
180
181if DEBUG:
182 # STATIC_ROOT = os.path.join(BASE_DIR, 'static')
183 MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'uploads')
184 FONT_ROOT = os.path.join(BASE_DIR, 'static', 'fonts')
185else:
186 MEDIA_ROOT = '/home/django/dev1.zdkvartira.ru/files/media'
187 STATIC_ROOT = '/home/django/dev1.zdkvartira.ru/files/static'
188 FONT_ROOT = STATIC_ROOT+"/fonts"
189
190PDF_LOGIN = 'zdkvartira'
191PDF_PASSWD = 'b079efa5b908337c174fc52985c885c7'