· 6 years ago · Jul 17, 2019, 08:08 AM
1"""
2Django settings for mysite project.
3
4Generated by '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
14
15from celery.schedules import crontab
16
17# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
18BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19
20
21# Quick-start development settings - unsuitable for production
22# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
23
24# SECURITY WARNING: keep the secret key used in production secret!
25SECRET_KEY = '=#+sttn&auyxnqins-zvm@eql6s9z+riv*@5ipyw)5z1oszzvg'
26
27# SECURITY WARNING: don't run with debug turned on in production!
28DEBUG = True
29
30ALLOWED_HOSTS = ['172.23.0.3', '*']
31
32PRODUCTION = False
33
34# Application definition
35
36INSTALLED_APPS = [
37 'raven.contrib.django.raven_compat',
38 'django.contrib.admin',
39 'django.contrib.auth',
40 'django.contrib.contenttypes',
41 'django.contrib.sessions',
42 'django.contrib.messages',
43 'django.contrib.staticfiles',
44 'main',
45# 'zeep',
46 'django_celery_beat',
47 'django_celery_results',
48]
49
50MIDDLEWARE = [
51 'django.middleware.security.SecurityMiddleware',
52 'django.contrib.sessions.middleware.SessionMiddleware',
53 'django.middleware.common.CommonMiddleware',
54 'django.middleware.csrf.CsrfViewMiddleware',
55 'django.contrib.auth.middleware.AuthenticationMiddleware',
56 'django.contrib.messages.middleware.MessageMiddleware',
57 'django.middleware.clickjacking.XFrameOptionsMiddleware',
58]
59
60ROOT_URLCONF = 'mysite.urls'
61
62TEMPLATES = [
63 {
64 'BACKEND': 'django.template.backends.django.DjangoTemplates',
65 'DIRS': [],
66 'APP_DIRS': True,
67 'OPTIONS': {
68 'context_processors': [
69 'django.template.context_processors.debug',
70 'django.template.context_processors.request',
71 'django.contrib.auth.context_processors.auth',
72 'django.contrib.messages.context_processors.messages',
73 ],
74 },
75 },
76]
77
78WSGI_APPLICATION = 'mysite.wsgi.application'
79
80
81# Database
82# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
83
84DATABASES = {
85 'default': {
86 'ENGINE': 'django.contrib.gis.db.backends.postgis',
87 'NAME': 'postgres',
88 'USER': 'qaqashqa',
89 'PASSWORD': 'kakashka_cherez_k',
90 'HOST': 'pg-master',
91 'PORT': '5432',
92 }
93}
94
95
96# Password validation
97# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
98
99AUTH_PASSWORD_VALIDATORS = [
100 {
101 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
102 },
103 {
104 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
105 },
106 {
107 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
108 },
109 {
110 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
111 },
112]
113
114
115# Internationalization
116# https://docs.djangoproject.com/en/2.1/topics/i18n/
117
118
119LANGUAGE_CODE = 'ru-RU'
120USE_I18N = False
121
122USE_L10N = False
123
124# TIME_ZONE = 'UTC'
125# USE_TZ = False
126
127TIME_ZONE = 'Europe/Samara'
128USE_TZ = False
129
130# Static files (CSS, JavaScript, Images)
131# https://docs.djangoproject.com/en/2.1/howto/static-files/
132
133STATIC_URL = '/static/'
134STATIC_ROOT = '/static'
135
136MEDIA_ROOT = '/static/'
137
138# Celery config
139CELERY_BROKER_URL= 'pyamqp://rabbitmq_fias:5672'
140CELERY_RESULT_BACKEND = 'django-db'
141CELERY_IGNORE_RESULT = True
142CELERY_BEAT_SCHEDULE = {
143 'req':{
144 'task':'main.tasks.req',
145 'schedule': crontab(minute=0),
146 }
147}
148
149CORS_ORIGIN_ALLOW_ALL = True
150CORS_ALLOW_CREDENTIALS = True
151CORS_ORIGIN_WHITELIST = (
152 ''
153)
154
155import raven
156
157RAVEN_CONFIG = {
158 'dsn': 'http://72716723f80f4bb0b587877b2a17bfea:755af36176054406b2380cc035c60e30@sentry.direktweb.ru/20',
159 # If you are using git, you can also automatically configure the
160 # release based on the git info.
161 #'release': raven.fetch_git_sha(os.path.dirname(__file__)),
162}
163APPEND_SLASH = True