source: sicp/sicp/settings.py @ 1ed9169

Last change on this file since 1ed9169 was 1ed9169, checked in by Ing. Roldan D. Vargas G <rvargas@…>, 9 years ago

se agrega la aplicacion django.contrib.humanize para darle formato a informacion de cifras numericas en las plantillas

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