source: sicp/sicp/settings.py @ 77fd7ee

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

se agrega estructura para el acceso a base de datos sigesic para la simulación de escenarios

  • Property mode set to 100644
File size: 5.7 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    'captcha',
45    'apps.comun',
46    'apps.usuario',
47)
48
49MIDDLEWARE_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
61ROOT_URLCONF = 'sicp.urls'
62
63BASE_TEMPLATES = os.path.join(BASE_DIR, "templates")
64
65TEMPLATES = [
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
81WSGI_APPLICATION = 'sicp.wsgi.application'
82
83
84# Database
85# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
86
87DATABASES = {
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
110LANGUAGE_CODE = 'es-ve'
111
112TIME_ZONE = 'UTC'
113
114USE_I18N = True
115
116USE_L10N = True
117
118USE_TZ = True
119
120
121# Static files (CSS, JavaScript, Images)
122# https://docs.djangoproject.com/en/1.8/howto/static-files/
123STATIC_ROOT = ''
124STATIC_URL = '/static/'
125
126STATICFILES_DIRS = (
127    os.path.join(BASE_DIR, 'static/'),
128)
129
130STATICFILES_FINDER = (
131    'django.contrib.staticfiles.finders.FileSystemFinder',
132    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
133)
134
135## URL de acceso al sistema
136LOGIN_URL = "/login"
137## URL de salida del sistema
138LOGOUT_URL = "/logout"
139
140LOCALE_PATHS = (
141    os.path.join(BASE_DIR, 'locale'),
142)
143
144## Registro de mensajes al usuario
145MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
146
147## Parámetros de configuración del panel administrativo del sistema
148SUIT_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
159EMAIL_HOST = 'localhost'
160## Puerto del Servfidor de correo SMTP
161EMAIL_PORT = 25
162## Dirección de correo electrónico del Simulador Integral de Cadenas Productivas
163EMAIL_FROM = 'sicp@cenditel.gob.ve'
164## Dirección de correo electrónico del Servidor
165SERVER_EMAIL = 'sicp@cenditel.gob.ve'
166## Dirección de correo electrónico por defecto
167DEFAULT_FROM_EMAIL = 'sicp@cenditel.gob.ve'
168
169## Registro de vitácoras de errores (logs)
170LOGS_PATH = '/var/log/sicp'
171
172## Configuración de los niveles de vitácoras (logs) a registrar
173LOGGING = 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
204CAPTCHA_WORDS_DICTIONARY = os.path.join(BASE_DIR, "static/dictionaries/captcha-es.txt")
205## Longitud de carácteres a mostrar en la imagen del captcha
206CAPTCHA_LENGTH = 6
207## Longitud de carácteres mínima permitida para extraer del diccionario
208CAPTCHA_DICTIONARY_MIN_LENGTH = 4
Note: See TracBrowser for help on using the repository browser.