1 | # coding=utf-8 |
---|
2 | """ |
---|
3 | Django settings for sicp project. |
---|
4 | |
---|
5 | Generated by 'django-admin startproject' using Django 1.8. |
---|
6 | |
---|
7 | For more information on this file, see |
---|
8 | https://docs.djangoproject.com/en/1.8/topics/settings/ |
---|
9 | |
---|
10 | For the full list of settings and their values, see |
---|
11 | https://docs.djangoproject.com/en/1.8/ref/settings/ |
---|
12 | """ |
---|
13 | |
---|
14 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
---|
15 | import os |
---|
16 | |
---|
17 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
---|
18 | |
---|
19 | VERSION = '3.0.0' |
---|
20 | |
---|
21 | |
---|
22 | # Quick-start development settings - unsuitable for production |
---|
23 | # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ |
---|
24 | |
---|
25 | # SECURITY WARNING: keep the secret key used in production secret! |
---|
26 | SECRET_KEY = 'exdo%=40*1ry3g2$nyi@oq-i+f^#q0_ksz(kd969^)y=#!zj7(' |
---|
27 | |
---|
28 | # SECURITY WARNING: don't run with debug turned on in production! |
---|
29 | DEBUG = True |
---|
30 | |
---|
31 | ALLOWED_HOSTS = ['localhost'] |
---|
32 | |
---|
33 | |
---|
34 | # Application definition |
---|
35 | |
---|
36 | INSTALLED_APPS = ( |
---|
37 | 'suit', # Modern theme for Django admin interface |
---|
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 | 'captcha', |
---|
45 | 'apps.comun', |
---|
46 | 'apps.usuario', |
---|
47 | ) |
---|
48 | |
---|
49 | MIDDLEWARE_CLASSES = ( |
---|
50 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
51 | 'django.middleware.common.CommonMiddleware', |
---|
52 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
53 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
54 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
---|
55 | 'django.contrib.messages.middleware.MessageMiddleware', |
---|
56 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
---|
57 | 'django.middleware.security.SecurityMiddleware', |
---|
58 | 'django.middleware.locale.LocaleMiddleware' |
---|
59 | ) |
---|
60 | |
---|
61 | ROOT_URLCONF = 'sicp.urls' |
---|
62 | |
---|
63 | BASE_TEMPLATES = os.path.join(BASE_DIR, "templates") |
---|
64 | |
---|
65 | TEMPLATES = [ |
---|
66 | { |
---|
67 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
---|
68 | 'DIRS': [BASE_TEMPLATES], |
---|
69 | 'APP_DIRS': True, |
---|
70 | 'OPTIONS': { |
---|
71 | 'context_processors': [ |
---|
72 | 'django.template.context_processors.debug', |
---|
73 | 'django.template.context_processors.request', |
---|
74 | 'django.contrib.auth.context_processors.auth', |
---|
75 | 'django.contrib.messages.context_processors.messages', |
---|
76 | ], |
---|
77 | }, |
---|
78 | }, |
---|
79 | ] |
---|
80 | |
---|
81 | WSGI_APPLICATION = 'sicp.wsgi.application' |
---|
82 | |
---|
83 | |
---|
84 | # Database |
---|
85 | # https://docs.djangoproject.com/en/1.8/ref/settings/#databases |
---|
86 | |
---|
87 | DATABASES = { |
---|
88 | 'default': { |
---|
89 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', |
---|
90 | 'NAME': '<DB-SICP>', |
---|
91 | 'USER': '<DB-USERNAME>', |
---|
92 | 'PASSWORD': '<DB-PASSWORD>', |
---|
93 | 'HOST': '<DB-HOST>', |
---|
94 | 'PORT': '<DB-PORT>', |
---|
95 | }, |
---|
96 | 'sigesic': { |
---|
97 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', |
---|
98 | 'NAME': '<DB-SIGESIC>', |
---|
99 | 'USER': '<DB-USERNAME>', |
---|
100 | 'PASSWORD': '<DB-PASSWORD>', |
---|
101 | 'HOST': '<DB-HOST>', |
---|
102 | 'PORT': '<DB_PORT>', |
---|
103 | } |
---|
104 | } |
---|
105 | |
---|
106 | |
---|
107 | # Internationalization |
---|
108 | # https://docs.djangoproject.com/en/1.8/topics/i18n/ |
---|
109 | |
---|
110 | LANGUAGE_CODE = 'es-ve' |
---|
111 | |
---|
112 | TIME_ZONE = 'UTC' |
---|
113 | |
---|
114 | USE_I18N = True |
---|
115 | |
---|
116 | USE_L10N = True |
---|
117 | |
---|
118 | USE_TZ = True |
---|
119 | |
---|
120 | |
---|
121 | # Static files (CSS, JavaScript, Images) |
---|
122 | # https://docs.djangoproject.com/en/1.8/howto/static-files/ |
---|
123 | STATIC_ROOT = '' |
---|
124 | STATIC_URL = '/static/' |
---|
125 | |
---|
126 | STATICFILES_DIRS = ( |
---|
127 | os.path.join(BASE_DIR, 'static/'), |
---|
128 | ) |
---|
129 | |
---|
130 | STATICFILES_FINDER = ( |
---|
131 | 'django.contrib.staticfiles.finders.FileSystemFinder', |
---|
132 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
---|
133 | ) |
---|
134 | |
---|
135 | ## URL de acceso al sistema |
---|
136 | LOGIN_URL = "/login" |
---|
137 | ## URL de salida del sistema |
---|
138 | LOGOUT_URL = "/logout" |
---|
139 | |
---|
140 | LOCALE_PATHS = ( |
---|
141 | os.path.join(BASE_DIR, 'locale'), |
---|
142 | ) |
---|
143 | |
---|
144 | ## Registro de mensajes al usuario |
---|
145 | MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage' |
---|
146 | |
---|
147 | ## Parámetros de configuración del panel administrativo del sistema |
---|
148 | SUIT_CONFIG = { |
---|
149 | # header |
---|
150 | 'ADMIN_NAME': 'SICP v%s' % VERSION, |
---|
151 | 'HEADER_DATE_FORMAT': 'l, d F Y', |
---|
152 | 'HEADER_TIME_FORMAT': 'h:i a', |
---|
153 | |
---|
154 | 'LIST_PER_PAGE': 15, |
---|
155 | } |
---|
156 | |
---|
157 | # Configuración de variables para el envío de correo electrónico |
---|
158 | ## Nombre del Servidor de correo SMTP |
---|
159 | EMAIL_HOST = 'localhost' |
---|
160 | ## Puerto del Servfidor de correo SMTP |
---|
161 | EMAIL_PORT = 25 |
---|
162 | ## Dirección de correo electrónico del Simulador Integral de Cadenas Productivas |
---|
163 | EMAIL_FROM = 'sicp@cenditel.gob.ve' |
---|
164 | ## Dirección de correo electrónico del Servidor |
---|
165 | SERVER_EMAIL = 'sicp@cenditel.gob.ve' |
---|
166 | ## Dirección de correo electrónico por defecto |
---|
167 | DEFAULT_FROM_EMAIL = 'sicp@cenditel.gob.ve' |
---|
168 | |
---|
169 | ## Registro de vitácoras de errores (logs) |
---|
170 | LOGS_PATH = '/var/log/sicp' |
---|
171 | |
---|
172 | ## Configuración de los niveles de vitácoras (logs) a registrar |
---|
173 | LOGGING = dict(version=1, disable_existing_loggers=True, formatters={ |
---|
174 | 'std': { |
---|
175 | 'format': '%(asctime)s %(levelname)-8s %(module)s %(funcname) %(message)s', |
---|
176 | } |
---|
177 | }, handlers={ |
---|
178 | 'null': { |
---|
179 | 'level': 'DEBUG', |
---|
180 | 'class': 'django.utils.log.NullHandler' |
---|
181 | }, |
---|
182 | 'comun': { |
---|
183 | 'class': 'logging.handlers.TimedRotatingFileHandler', |
---|
184 | 'level': 'DEBUG', |
---|
185 | 'formatter': 'std', |
---|
186 | 'filename': os.path.join(LOGS_PATH, 'comun.log'), |
---|
187 | 'when': 'w6', |
---|
188 | 'interval': 1, |
---|
189 | 'backupCount': 52 |
---|
190 | }, |
---|
191 | 'usuario': { |
---|
192 | 'class': 'logging.handlers.TimedRotatingFileHandler', |
---|
193 | 'level': 'DEBUG', |
---|
194 | 'formatter': 'std', |
---|
195 | 'filename': os.path.join(LOGS_PATH, 'usuario.log'), |
---|
196 | 'when': 'w6', |
---|
197 | 'interval': 1, |
---|
198 | 'backupCount': 52 |
---|
199 | } |
---|
200 | }) |
---|
201 | |
---|
202 | # Configuración del CAPTCHA |
---|
203 | ## Ruta en donde se encuentra el diccionario de palabras a utilizar en la generación del captcha |
---|
204 | CAPTCHA_WORDS_DICTIONARY = os.path.join(BASE_DIR, "static/dictionaries/captcha-es.txt") |
---|
205 | ## Longitud de carácteres a mostrar en la imagen del captcha |
---|
206 | CAPTCHA_LENGTH = 6 |
---|
207 | ## Longitud de carácteres mínima permitida para extraer del diccionario |
---|
208 | CAPTCHA_DICTIONARY_MIN_LENGTH = 4 |
---|