[d7b19bc] | 1 | # -*- coding: utf-8 -*- |
---|
| 2 | """ |
---|
| 3 | Sistema Gestor de Consultas Públicas |
---|
| 4 | |
---|
| 5 | Copyleft (@) 2017 CENDITEL nodo Mérida - https://planificacion.cenditel.gob.ve/trac/wiki/ModeladoTopicos_2017 |
---|
| 6 | """ |
---|
| 7 | ## @package gestor_consulta.settings |
---|
| 8 | # |
---|
| 9 | # Configuración de funcionalidades y parámetros del sistema |
---|
| 10 | # @author Generated by 'django-admin startproject' using Django 1.11. |
---|
| 11 | # @author Rodrigo Boet (rboet at cenditel.gob.ve) |
---|
| 12 | # @author <a href='http://www.cenditel.gob.ve'>Centro Nacional de Desarrollo e Investigación en TecnologÃas Libres |
---|
| 13 | # (CENDITEL) nodo Mérida - Venezuela</a> |
---|
[4cafdf1] | 14 | # @copyright <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU Public License versión 3 (GPLv3)</a> |
---|
[d7b19bc] | 15 | # @version 1.0 |
---|
| 16 | |
---|
| 17 | import os |
---|
| 18 | |
---|
| 19 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
---|
| 20 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | # Quick-start development settings - unsuitable for production |
---|
| 24 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ |
---|
| 25 | |
---|
| 26 | # SECURITY WARNING: keep the secret key used in production secret! |
---|
| 27 | SECRET_KEY = 'q0=893&qa)i5ydd&%tcx9=_3hmjqyqhcyg7c-j-8i617_wh#k2' |
---|
| 28 | |
---|
| 29 | # SECURITY WARNING: don't run with debug turned on in production! |
---|
| 30 | DEBUG = True |
---|
| 31 | |
---|
| 32 | ALLOWED_HOSTS = ['*'] |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | # Application definition |
---|
| 36 | |
---|
| 37 | # Application definition |
---|
| 38 | |
---|
| 39 | DJANGO_APPS = [ |
---|
| 40 | 'django.contrib.admin', |
---|
| 41 | 'django.contrib.auth', |
---|
| 42 | 'django.contrib.contenttypes', |
---|
| 43 | 'django.contrib.sessions', |
---|
| 44 | 'django.contrib.messages', |
---|
| 45 | 'django.contrib.staticfiles', |
---|
| 46 | 'captcha', |
---|
| 47 | 'rest_framework', |
---|
[9eeb2c3] | 48 | 'django_filters', |
---|
[d7b19bc] | 49 | ] |
---|
| 50 | |
---|
| 51 | PROJECT_APPS = [ |
---|
| 52 | 'base', |
---|
| 53 | 'consulta', |
---|
| 54 | 'users', |
---|
| 55 | ] |
---|
| 56 | |
---|
| 57 | INSTALLED_APPS = DJANGO_APPS + PROJECT_APPS |
---|
| 58 | |
---|
| 59 | MIDDLEWARE = [ |
---|
| 60 | 'django.middleware.security.SecurityMiddleware', |
---|
| 61 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
| 62 | 'django.middleware.common.CommonMiddleware', |
---|
| 63 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
| 64 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
| 65 | 'django.contrib.messages.middleware.MessageMiddleware', |
---|
| 66 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
---|
| 67 | ] |
---|
| 68 | |
---|
| 69 | ROOT_URLCONF = 'gestor_consulta.urls' |
---|
| 70 | |
---|
| 71 | TEMPLATES = [ |
---|
| 72 | { |
---|
| 73 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
---|
| 74 | 'DIRS': [], |
---|
| 75 | 'APP_DIRS': True, |
---|
| 76 | 'OPTIONS': { |
---|
| 77 | 'context_processors': [ |
---|
| 78 | 'django.template.context_processors.debug', |
---|
| 79 | 'django.template.context_processors.request', |
---|
| 80 | 'django.contrib.auth.context_processors.auth', |
---|
| 81 | 'django.contrib.messages.context_processors.messages', |
---|
| 82 | ], |
---|
| 83 | }, |
---|
| 84 | }, |
---|
| 85 | ] |
---|
| 86 | |
---|
| 87 | WSGI_APPLICATION = 'gestor_consulta.wsgi.application' |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | # Database |
---|
| 91 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases |
---|
| 92 | |
---|
| 93 | DATABASES = { |
---|
| 94 | 'default': { |
---|
| 95 | 'ENGINE': 'django.db.backends.sqlite3', |
---|
| 96 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
---|
| 97 | } |
---|
| 98 | } |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | # Password validation |
---|
| 102 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators |
---|
| 103 | |
---|
| 104 | AUTH_PASSWORD_VALIDATORS = [ |
---|
| 105 | { |
---|
| 106 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
---|
| 107 | }, |
---|
| 108 | { |
---|
| 109 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
---|
| 110 | }, |
---|
| 111 | { |
---|
| 112 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
---|
| 113 | }, |
---|
| 114 | { |
---|
| 115 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
---|
| 116 | }, |
---|
| 117 | ] |
---|
| 118 | |
---|
| 119 | |
---|
| 120 | # Internationalization |
---|
| 121 | # https://docs.djangoproject.com/en/1.11/topics/i18n/ |
---|
| 122 | |
---|
| 123 | ## Configuración del código del lenguaje a utilizar por defecto |
---|
| 124 | LANGUAGE_CODE = 'es-ve' |
---|
| 125 | |
---|
| 126 | ## Configuración para el nombre de localización por defecto |
---|
| 127 | LOCALE_NAME = 'es' |
---|
| 128 | |
---|
| 129 | ## Configuración para la zona horaria por defecto |
---|
| 130 | TIME_ZONE = 'America/Caracas' |
---|
| 131 | |
---|
| 132 | USE_I18N = True |
---|
| 133 | |
---|
| 134 | USE_L10N = True |
---|
| 135 | |
---|
| 136 | USE_TZ = True |
---|
| 137 | |
---|
| 138 | ## Configuración para el logeo de usuarios |
---|
| 139 | |
---|
| 140 | LOGIN_URL = "/login" |
---|
| 141 | |
---|
| 142 | LOGOUT_URL= "/logout" |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | # Static files (CSS, JavaScript, Images) |
---|
| 146 | # https://docs.djangoproject.com/en/1.11/howto/static-files/ |
---|
| 147 | |
---|
| 148 | STATIC_URL = '/static/' |
---|
| 149 | |
---|
| 150 | ## Configuración de los directorios en donde se encuentran los archivos estáticos |
---|
| 151 | STATICFILES_DIRS = ( |
---|
| 152 | os.path.join(BASE_DIR, 'static/'), |
---|
| 153 | ) |
---|
| 154 | |
---|
| 155 | ## Ruta de los archivos del pre-procesamiento |
---|
| 156 | PROCESAMIENTO_PATH = os.path.join(BASE_DIR, 'static/procesamiento_files') |
---|
| 157 | |
---|
[2353277] | 158 | EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |
---|
| 159 | |
---|
[fecfc90] | 160 | ## Configuraciones del rest framework |
---|
[2353277] | 161 | REST_FRAMEWORK = { |
---|
[9eeb2c3] | 162 | 'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',), |
---|
[4cafdf1] | 163 | #'DEFAULT_PERMISSION_CLASSES': ( |
---|
| 164 | # 'rest_framework.permissions.IsAuthenticated', |
---|
| 165 | #), |
---|
[d45fcdc] | 166 | 'DEFAULT_AUTHENTICATION_CLASSES': ( |
---|
| 167 | 'rest_framework.authentication.SessionAuthentication', |
---|
[fecfc90] | 168 | 'rest_framework_jwt.authentication.JSONWebTokenAuthentication', |
---|
[d45fcdc] | 169 | ), |
---|
[2353277] | 170 | } |
---|
[6211c29] | 171 | |
---|