1 | # -*- coding: utf-8 -*- |
---|
2 | """ |
---|
3 | Sistema Integrado de Planificacion Estrategica Situacional |
---|
4 | |
---|
5 | Copyleft (@) 2017 CENDITEL nodo Mérida - https://planificacion.cenditel.gob.ve/trac/wiki/SIPES_Comunal/ |
---|
6 | """ |
---|
7 | |
---|
8 | import os |
---|
9 | |
---|
10 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
---|
11 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
---|
12 | |
---|
13 | |
---|
14 | # Quick-start development settings - unsuitable for production |
---|
15 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ |
---|
16 | |
---|
17 | # SECURITY WARNING: keep the secret key used in production secret! |
---|
18 | SECRET_KEY = 's+8k&_3l23paz(mq%!lqa=$%e03lx%#3g@=1!#$h77+py*ke*-' |
---|
19 | |
---|
20 | # SECURITY WARNING: don't run with debug turned on in production! |
---|
21 | DEBUG = True |
---|
22 | |
---|
23 | ALLOWED_HOSTS = ['*'] |
---|
24 | |
---|
25 | |
---|
26 | # Application definition |
---|
27 | |
---|
28 | DJANGO_APPS = [ |
---|
29 | 'django.contrib.admin', |
---|
30 | 'django.contrib.auth', |
---|
31 | 'django.contrib.contenttypes', |
---|
32 | 'django.contrib.sessions', |
---|
33 | 'django.contrib.messages', |
---|
34 | 'django.contrib.staticfiles', |
---|
35 | 'django.contrib.gis', |
---|
36 | 'captcha', |
---|
37 | ] |
---|
38 | |
---|
39 | PROJECT_APPS = [ |
---|
40 | 'utils', |
---|
41 | 'users', |
---|
42 | 'consultas', |
---|
43 | 'estudio_problemas', |
---|
44 | 'explicacion_situacional', |
---|
45 | 'plan_integral', |
---|
46 | ] |
---|
47 | |
---|
48 | INSTALLED_APPS = DJANGO_APPS + PROJECT_APPS |
---|
49 | |
---|
50 | MIDDLEWARE = [ |
---|
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 | |
---|
60 | ROOT_URLCONF = 'sapic.urls' |
---|
61 | |
---|
62 | # Definir los Templates |
---|
63 | |
---|
64 | UTILS_TEMPLATES = os.path.join(BASE_DIR, "utils/templates") |
---|
65 | USERS_TEMPLATES = os.path.join(BASE_DIR, "users/templates") |
---|
66 | EXSIT_TEMPLATES = os.path.join(BASE_DIR, "explicacion_situacional/templates") |
---|
67 | |
---|
68 | TEMPLATES = [ |
---|
69 | { |
---|
70 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
---|
71 | 'DIRS': [UTILS_TEMPLATES, USERS_TEMPLATES, EXSIT_TEMPLATES], |
---|
72 | 'APP_DIRS': True, |
---|
73 | 'OPTIONS': { |
---|
74 | 'context_processors': [ |
---|
75 | 'django.template.context_processors.debug', |
---|
76 | 'django.template.context_processors.request', |
---|
77 | 'django.contrib.auth.context_processors.auth', |
---|
78 | 'django.contrib.messages.context_processors.messages', |
---|
79 | ], |
---|
80 | }, |
---|
81 | }, |
---|
82 | ] |
---|
83 | |
---|
84 | WSGI_APPLICATION = 'sapic.wsgi.application' |
---|
85 | |
---|
86 | |
---|
87 | # Database |
---|
88 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases |
---|
89 | |
---|
90 | DATABASES = { |
---|
91 | 'default': { |
---|
92 | 'ENGINE': 'django.contrib.gis.db.backends.postgis', # Se usa postgis para el uso De GeoDjango |
---|
93 | 'NAME': 'nombre_base_datos', |
---|
94 | 'USER': 'nombre_usuario', |
---|
95 | 'PASSWORD': 'passw', |
---|
96 | 'HOST': 'localhost', |
---|
97 | 'PORT': '5432', |
---|
98 | 'ATOMIC_REQUESTS': True, # Crea transacciones en cada peticion de la vista |
---|
99 | } |
---|
100 | } |
---|
101 | |
---|
102 | |
---|
103 | # Password validation |
---|
104 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators |
---|
105 | |
---|
106 | AUTH_PASSWORD_VALIDATORS = [ |
---|
107 | { |
---|
108 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
---|
109 | }, |
---|
110 | { |
---|
111 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
---|
112 | }, |
---|
113 | { |
---|
114 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
---|
115 | }, |
---|
116 | { |
---|
117 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
---|
118 | }, |
---|
119 | ] |
---|
120 | |
---|
121 | |
---|
122 | # Internationalization |
---|
123 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ |
---|
124 | |
---|
125 | LANGUAGE_CODE = 'es-ve' |
---|
126 | |
---|
127 | LOCALE_NAME = 'es' |
---|
128 | |
---|
129 | TIME_ZONE = 'America/Caracas' |
---|
130 | |
---|
131 | USE_I18N = True |
---|
132 | |
---|
133 | USE_L10N = True |
---|
134 | |
---|
135 | USE_TZ = True |
---|
136 | |
---|
137 | MEDIA_ROOT = os.path.join(BASE_DIR, 'sources/') |
---|
138 | MEDIA_URL = '/sources/' |
---|
139 | |
---|
140 | # Static files (CSS, JavaScript, Images) |
---|
141 | # https://docs.djangoproject.com/en/1.8/howto/static-files/ |
---|
142 | |
---|
143 | SOURCES_URL = BASE_DIR + 'sources/' |
---|
144 | STATIC_ROOT = BASE_DIR + 'static/' |
---|
145 | STATIC_URL = '/static/' |
---|
146 | |
---|
147 | # Configuración de los directorios en donde se encuentran los archivos estáticos |
---|
148 | STATICFILES_DIRS = ( |
---|
149 | os.path.join(BASE_DIR, 'static/'), |
---|
150 | os.path.join(BASE_DIR, 'sources/'), |
---|
151 | ) |
---|
152 | |
---|
153 | # Configuración para el logeo de usuarios |
---|
154 | |
---|
155 | LOGIN_URL = "/" |
---|
156 | |
---|
157 | LOGOUT_URL= "/logout" |
---|
158 | |
---|
159 | |
---|
160 | EMAIL_USE_TLS = True |
---|
161 | |
---|
162 | EMAIL_HOST = 'smtp.gmail.com' |
---|
163 | EMAIL_PORT = 587 |
---|
164 | EMAIL_HOST_USER = 'nombre_email@gmail.com' |
---|
165 | EMAIL_HOST_PASSWORD = 'passwordemail' |
---|
166 | EMAIL_FROM = EMAIL_HOST_USER |
---|