Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2019
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 23.98 KB | None | 0 0
  1. # -*- encoding: utf-8 -*-
  2. # Django settings for ryca project.
  3.  
  4. '''
  5.    Archivo de configuración del proyecto
  6. '''
  7.  
  8. import os
  9. from datetime import datetime
  10.  
  11. RYCA_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
  12.  
  13. ##################################################################################
  14. '''
  15.     Variables del proyecto
  16. '''
  17. # Listado de filas por pagina
  18. LIST_PER_PAGE = 15
  19. LIST_PER_PAGE_INLINE = 5
  20. # Cantidad de filas para el ingreso se un nuevo registro
  21. NUM_ROW_NEW = 1
  22. #Variable choise para opcion SI y NO Generica para el sistema
  23. OPTION_YES_NO = (('Y','SI'),('N','NO'))
  24. # Tipos de Sexo  
  25. SEX_OPTIONS = (('M','Masculino'),('F','Femenino'))
  26. # Tipos de Sexo  
  27. ESTADO_OPTIONS = (('A','ACTIVO'),('I','INACTIVO'))
  28. # Calendario académico de Colegios
  29. CALENDARIO = (('A','A'),('B','B'),('C','C'),('D','D'),('N','N'))
  30. # Caracteres de Colegios
  31. CARACTER = (('O','OFICIAL'),('P','PRIVADO'))
  32. # Tipo de Matricula Financiera
  33. TIPO_FINANCIERA = (('O','ORDINARIA'), ('E','EXTEMPORANEA'),('X','EXTRAORDINARIA'))
  34. # Tipo Estimulos
  35. TIPO_ESTIMULO = {'ESTIMULO': 1, 'CONVENIO': 2}
  36.  
  37. # Tipo evaluador para la evaluación docente
  38. EVALUADOR = ( ('E', 'ESTUDIANTE'), ('D', 'DOCENTE'), ('F','FACULTAD' ))
  39.  
  40. # Tipo Pago para valores de programa
  41. TIPO_VALORES = ( ('I','INSCRIPCION'),('M','MATRICULA') )
  42. ADMIN_URL = 'home'
  43. LOGIN_URL = '/login'
  44. # Porcentajes pruebas selección
  45. PORCENTAJE_PRUEBAS = 100
  46. # tipos de ingreso
  47. #FIXME: Mirar tabla t_tipo_ingresos respecto al siguiente diccionario y unificar
  48. TIPO_INGRESO =  {'CONVOCATORIA': 1 , 'TRANSFERENCIA_INTERNA': 2, 'TRANSFERENCIA_EXTERNA': 3, 'ARTICULACION': 4, 'CONTINUIDAD_PROPEDEUTICA': 5, 'OTROS': 6 }
  49.  
  50. #Determina los filtros a aplicar para la consulta sobre el plan de estudios del estudiante
  51. OPCIONES_FILTRO_MATRICULA = {'ALL':0, 'MATRICULADAS':1, 'PORMATRICULAR':2, 'PORAPROBAR': 3, 'ADICIONES': 4,  
  52.                             'CANCELADAS' : 5, 'CURSADAS': 6,'PORAPROBAR_HABILITABLE':7, 'PORAPROBAR_VALIDABLE': 8}
  53. # Rango de edad para registro en el sistema
  54. EDAD = {'MIN': 13, 'MAX': 70 }
  55. annio = datetime.now().year
  56. BIRTH_YEAR_CHOICES = list( reversed ( range(annio - EDAD['MAX'], annio - EDAD['MIN']) ))
  57.  
  58. #ACCIONES SOBRE LA MATRICULA DE ESPACIOS ACADEMICOS
  59. ESTADO_MATRICULA = { 'PREMATRICULADA': 'P', 'MATRICULADA': 'M', 'CANCELADA': 'C' }
  60. ESTADO_ASIGNATURA = ( ('M','MATRICULADA'), ('A', 'ADICION'), ('C','CANCELACION') )
  61. CLASS_LABELS = [  'label label-info', 'label label-success', 'label label-primary', 'label label-warning', 'label label-danger', 'label label-default' ]
  62. CLASS_ESTADO = {'M': CLASS_LABELS[1], 'A': CLASS_LABELS[3], 'C': CLASS_LABELS[4]}
  63.  
  64.  
  65. EVENTOS_ACADEMICOS = { "PREINSCRIPCION": 1, "INSCRIPCION": 2, "MATRICULA_ACADEMICA": 3, "PAGO_ORDINARIO": 4,
  66.                       "PAGO_EXTRAORDINARIO": 5, "ADICION": 6, "CANCELACION_ESPACIO": 7,
  67.                       "HOMOLOGACIONES": 8, "VALIDACIONES": 9, "CONTINUIDAD ACADEMICA": 10,
  68.                       "CURSO_VACACIONAL": 13, "DIPLOMADO": 14, "SEMINARIO": 17, "HABILITACIONES": 21,
  69.                       "SOLICITUD_ESTIMULO": 23, "SELECCION_HORARIO": 24,  "CURSO_CAPACITACION": 25 ,"RECEPCION DOCUMENTOS GRADO": 26, "GRADOS": 27,
  70.                       "PRUEBAS DE SELECCION": 28, "PUBLICACION DE ADMITIDOS": 29, "INDUCCION": 30, "INICIO_CLASES": 31,
  71.                       "SOLICITUD SALIDAS PEDAGOGICAS": 32, "RECESO": 33, "INICIO_ELECTIVAS": 34, "APROBACION DE ESTIMULOS": 35,
  72.                       "REGISTRO_ELECTIVAS": 36, "REVISION Y AJUSTES": 37, "CALIFICACION ELECTIVAS": 38,
  73.                       "EVALUACION_1_CORTE": 51, "EVALUACION_2_CORTE": 52, "EVALUACION_3_CORTE": 53, "PRIMER_CORTE": 57,
  74.                       "SEGUNDO_CORTE": 58, "TERCER_CORTE": 59, "NOTAS_1_CORTE": 54, "NOTAS_2_CORTE": 55,
  75.                       "NOTAS_3_CORTE": 56, "CALIFICACION_DOCENTE": 79 }
  76.  
  77. # Cuales de los productos son excluidos para facutacion por valor unico
  78. EXCLUIR_PRODUCTOS = ( EVENTOS_ACADEMICOS['PREINSCRIPCION'], EVENTOS_ACADEMICOS['MATRICULA_ACADEMICA'],  EVENTOS_ACADEMICOS['CURSO_VACACIONAL'] ,
  79.                       EVENTOS_ACADEMICOS['DIPLOMADO'],  EVENTOS_ACADEMICOS['SEMINARIO'],  EVENTOS_ACADEMICOS['CURSO_CAPACITACION'] )
  80.  
  81. ## Indica los codigos del evento tipo Cortes de la tabla ConceptoProcesosPago
  82. CORTES = ( EVENTOS_ACADEMICOS['PRIMER_CORTE'] ,  EVENTOS_ACADEMICOS['SEGUNDO_CORTE'],  EVENTOS_ACADEMICOS['TERCER_CORTE' ])
  83. #Cantidad de cortes institucionales para efectos de notas regulares
  84. NUM_CORTES_PERIODO = len(CORTES)
  85.  
  86. TIPO_DESCUENTOS = {'SMMLV': 3, 'VALOR_PROGRAMA': 0, 'COSTO_MATRICULA': 1, 'mSMMLV': 2}
  87. DESCUENTO_VOTACION = 0.1
  88.  
  89.  
  90. #Cantidad de Electivas de bienestar universatario a cursar por los estudiantes
  91. CANTIDAD_ELECTIVAS = 1
  92. ELECTIVAS_X_SEMESTRE = 1
  93.  
  94.  
  95.  
  96.  
  97. #Estados solicitud
  98. ESTADOS_SOLICITUD = { 'SIN_REVISION': {'CODIGO':0,'DESCRIPCION':'SIN REVISION'},
  99.                       'NEGADO': {'CODIGO': 1,'DESCRIPCION': 'SOLICITUD NEGADA'},
  100.                       'APROBADO':{'CODIGO':2,'DESCRIPCION':'SOLICITUD APROBADA'},
  101.                       'LEGALIZADO': {'CODIGO':3, 'DESCRIPCION':'SOLICITUD LAGALIZADA'},
  102.                       'CAMBIO':{'CODIGO':4,'DESCRIPCION':'CAMBIO SOLICITUD'},
  103.                       'BLOQUEADO':{'CODIGO':4,'DESCRIPCION':'BLOQUEADO'},
  104.                     }
  105. CLASS_SOLICITUD = [CLASS_LABELS[5], CLASS_LABELS[4], CLASS_LABELS[1], CLASS_LABELS[0], CLASS_LABELS[3]]
  106.  
  107. # Longitud del numero telefonico valido
  108. PHONE = {'MIN': 7, 'MAX': 13 }
  109. #Valores máximos y mínimos para matricula
  110.  
  111. CRED_MATRICULAS = {'MIN': 0.6, 'MAX': 1, 'ADD': 6 }
  112. # Valor que toma una variable cuando no es ninguno de los anteriores (No confundir con Nulo)
  113. KEY_NONE = -1
  114. NONE = { KEY_NONE : u'Ninguno de los anteriores'  }
  115. # Flag que indica si se va a realizar un control por propedéutica
  116. CONTROL_PROPEDEUTICA = True
  117. # Longitud mínima de Password
  118. MIN_PASSWORD = 8
  119. # SEMANAS POR DEFECTO PARA CADA PERIODO
  120. SEMANAS = 16
  121. # DEPENDENCIA POR DEFECTO PARA LOS PROGRAMAS CARGADOS
  122. DEPENDENCIA_DEFAULT = 0
  123. # CODIGO DE BARRAS TIPO
  124. NUM_BARCODE = ( (1,'ORDINARIO'),(2,'EXTRAORDINARIO'))
  125.  
  126.  
  127. ### JORNADAS
  128. JORNADAS = ( ('D', 'DIURNO'),('N','NOCTURNO'),('M', 'MIXTA') )
  129.  
  130. ## SNIES
  131.  
  132. #Maximos semestres en SNIES
  133. MAX_SEMESTRE_SNIES = 2
  134.  
  135. #TIPOS DE NOTA
  136. #TIPO_NOTA = {'RE': 1 , 'HA': 2, 'HO': 3, 'VA': 4, 'CN': 5, 'PP': 6,  'TG': 7, 'DI': 8,'PF':11 }
  137. TIPO_NOTA = {'REGULAR': 1, 'HABILITACION': 2, 'HOMOLOGACION': 3, 'VALIDACION': 4, \
  138.               'CURSOS_VACACIONES': 5,  'HOMOLOGACION_INTERNA': 6, 'TRABAJO_GRADO': 7, 'DIPLOMADO': 8, 'CONVALIDACION': 9}
  139.  
  140. EXCLUIR_PROMEDIO = ( TIPO_NOTA['CONVALIDACION'], TIPO_NOTA['HOMOLOGACION'])
  141.  
  142.  
  143. #Tipificacion areas_comunes
  144. AREAS_TYPE = ( ('1', 'DE PROGRAMA'), ('2', 'BIENESTAR UNIVERSIRARIO'), ('3', 'EDUCACION PARA EL TRABAJO')  )
  145.  
  146. """
  147.    Patrones para Validadores
  148. """
  149. DOCUMENT_FORMAT = r'^[0-9]*$'
  150. PERIOD_FORMAT = r'^[A-Z]-[0-9]{4}$'
  151. DATE_FORMAT = '%Y/%m/%d'
  152. #DATETIME_INPUT_FORMATS = '%d-%m-%Y'
  153. NAME_FORMAT=ur"^[A-Za-z]{2,}([\s][A-Za-z]{2,})*$"
  154.  
  155. """
  156. Roles fijos del sistema
  157. """
  158. STATIC_PROFILES  = {
  159.             'ASPIRANTE': 1, 'ESTUDIANTE': 2, 'PROFESOR': 3, 'FINANCIERA': 9, 'EXTERNO': 19,
  160.         }
  161.  
  162. #Indica que roles no pueden ser agregados desde el backend de usuarios
  163. NOAVAILABLE_GROUPS = [ STATIC_PROFILES['ASPIRANTE'], STATIC_PROFILES['ESTUDIANTE'] ]
  164.  
  165.  
  166.  
  167. # Financiera
  168. #Longitud del consecutivo para recibos
  169. RECIBO_LEN = 9
  170. ESTADOS_RECIBO = ( ('S', 'NO CONFIRMADO'), ('C', 'CONFIRMADO'), ('A', 'ANULADO' ), ('D', 'DEVUELTO' ), ('P', 'PENDIENTE POR SALDO'))
  171. CLASS_RECIBO = { 'S': 'label label-default', 'C': 'label label-success', 'A': 'label label-danger', 'D': 'label label-info', 'P': 'label label-warning' }
  172. ##################################################################################+
  173.  
  174.  
  175.  
  176. ### variables de django
  177.  
  178. DEBUG = True
  179. TEMPLATE_DEBUG = DEBUG
  180.  
  181. DEBUG_TOOLBAR_PANELS = [
  182.     'debug_toolbar.panels.versions.VersionsPanel',
  183.     'debug_toolbar.panels.timer.TimerPanel',
  184.     'debug_toolbar.panels.settings.SettingsPanel',
  185.     'debug_toolbar.panels.headers.HeadersPanel',
  186.     'debug_toolbar.panels.request.RequestPanel',
  187.     'debug_toolbar.panels.sql.SQLPanel',
  188.     'debug_toolbar.panels.staticfiles.StaticFilesPanel',
  189.     'debug_toolbar.panels.templates.TemplatesPanel',
  190.     'debug_toolbar.panels.cache.CachePanel',
  191.     'debug_toolbar.panels.signals.SignalsPanel',
  192.     'debug_toolbar.panels.logging.LoggingPanel',
  193.     'debug_toolbar.panels.redirects.RedirectsPanel',
  194. ]
  195. INTERCEPT_REDIRECTS = False
  196. INTERNAL_IPS = ('127.0.0.1',)
  197.  
  198. ADMINS = (
  199.     # ('Your Name', 'your_email@example.com'),
  200.     ('Wilson Pimiento', 'wpimiento@itfip.edu.co'),
  201.     ('Darwin Munoz', 'dmunoz@itfip.edu.co'),
  202. )
  203.  
  204. MANAGERS = ADMINS
  205.  
  206. ENVIRONMENT = {
  207.  
  208.         'production': {
  209.             'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  210.             'NAME': 'ryca',                      # Or path to database file if using sqlite3.
  211.             # The following settings are not used with sqlite3:
  212.             'USER': 'postgres',
  213.             'PASSWORD': 'ccaga65692337xx',
  214.             'HOST': '192.168.11.34',             # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
  215.             'PORT': '5434',
  216.             'CONN_MAX_AGE': 60,                      # Set to empty string for default.
  217.         },
  218.  
  219.         'local': {
  220.             'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  221.             'NAME': 'test_ryca',                      # Or path to database file if using sqlite3.
  222.             # The following settings are not used with sqlite3:
  223.             'USER': 'postgres',
  224.             'PASSWORD': '1118niwradsaxdesarrollo',
  225.             'HOST': '192.168.11.79',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
  226.             'PORT': '5434',                      # Set to empty string for default.
  227.             'CONN_MAX_AGE': 60,
  228.         },
  229.  
  230.  }
  231.  
  232.  
  233. DATABASES = {
  234.     'default': {
  235.         'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
  236.         'NAME': os.environ.get('RYCA_DB_NAME', ''),                      # Or path to database file if using sqlite3.
  237.         # The following settings are not used with sqlite3:
  238.         'USER': os.environ.get('RYCA_DB_USER', ''),
  239.         'PASSWORD': os.environ.get('RYCA_DB_PASSWORD', ''),
  240.         'HOST': os.environ.get('RYCA_DB_HOST', ''),           # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
  241.         'PORT': os.environ.get('RYCA_DB_PORT', '5432'),
  242.         'CONN_MAX_AGE': 60,                      # Set to empty string for default.
  243.     },
  244. }
  245.  
  246. # Defino en una lista los enrutadores de las conexiones a las diferentes DB
  247. #DATABASE_ROUTERS = ['snies.router.SniesRouter',]
  248.  
  249.  
  250. if  not DEBUG:
  251.     EMAIL_HOST = 'localhost'
  252.     EMAIL_PORT = 1025
  253.     EMAIL_HOST_USER = ''
  254.     EMAIL_HOST_PASSWORD = ''
  255.     EMAIL_USE_TLS = False
  256.     DEFAULT_FROM_EMAIL = 'testing@example.com'
  257.     # run in terminal: python -m smtpd -n -c DebuggingServer localhost:1025
  258. else:
  259.     EMAIL_USE_TLS = True
  260.     EMAIL_HOST = 'smtp.gmail.com'
  261.     EMAIL_ACCOUNTS = {'soporte1_ryca@itfip.edu.co': 'sryca001+',
  262.                       'soporte2_ryca@itfip.edu.co': 'sryca002+',
  263.                       'soporte3_ryca@itfip.edu.co': 'sryca003+',
  264.                       'soporte4_ryca@itfip.edu.co': 'sryca004+',
  265.                       'soporte5_ryca@itfip.edu.co': 'sryca005+',
  266.                        }
  267.     ACCOUNTS = EMAIL_ACCOUNTS.items()
  268.     EMAIL_HOST_USER = EMAIL_ACCOUNTS.items()[0][0]
  269.     EMAIL_HOST_PASSWORD = EMAIL_ACCOUNTS.items()[0][1]
  270.     EMAIL_PORT = 587
  271.  
  272. EMAIL_SUBJECTS = { 'PREINSCRIPCION': 'Preinscripción realizada', 'INSCRIPCION': 'Inscripción satisfactoria', 'PROMOCION': 'Aspirante Promovido',
  273.                   'PAGO': 'Pago realizado','VERIFICACION_PREINSCRIPCION':'Revisar la información','VERIFICACION_ESTIMULOS':'Verificar informacion estimulos' }
  274.  
  275.  
  276.  
  277. ## SESIONES
  278. SESSION_EXPIRE_AT_BROWSER_CLOSE = True
  279. SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
  280.  
  281. ## CACHE
  282. ## PARA PRODUCTION PONER MEMCACHE
  283. CACHES = {
  284.     'default': {
  285.         'BACKEND': 'ryca.cache_backend.MemcachedCache',
  286.         'LOCATION': "%s:11211" % os.environ.get('RYCA_MEMCACHE_HOST', '192.168.11.79'),
  287.         'TIMEOUT': 86400,
  288.     }
  289. }
  290.  
  291.  
  292. # Hosts/domain names that are valid for this site; required if DEBUG is False
  293. # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
  294. ALLOWED_HOSTS = ['*']
  295. # Local time zone for this installation. Choices can be found here:
  296. # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
  297. # although not all choices may be available on all operating systems.
  298. # In a Windows environment this must be set to your system time zone.
  299. TIME_ZONE = 'America/Bogota'
  300.  
  301. # Language code for this installation. All choices can be found here:
  302. # http://www.i18nguy.com/unicode/language-identifiers.html
  303. LANGUAGE_CODE = 'es-CO'
  304. #LANGUAGE_CODE = 'en-us'
  305.  
  306. ENCODING='utf8'
  307. LOCALE = "es_CO.utf-8"
  308.  
  309. SITE_ID = 1
  310.  
  311. # If you set this to False, Django will make some optimizations so as not
  312. # to load the internationalization machinery.
  313. USE_I18N = True
  314.  
  315. # If you set this to False, Django will not format dates, numbers and
  316. # calendars according to the current locale.
  317. USE_L10N = True
  318.  
  319.  
  320. # If you set this to False, Django will not use timezone-aware datetimes.
  321. USE_TZ = True
  322.  
  323. # Absolute filesystem path to the directory that will hold user-uploaded files.
  324. # Example: "/var/www/example.com/media/"
  325. MEDIA_ROOT = RYCA_PATH+'/ryca/media'
  326.  
  327. # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  328. # trailing slash.
  329. # Examples: "http://example.com/media/", "http://media.example.com/"
  330. MEDIA_URL = '/media/'
  331. PHOTO_UPLOAD = 'photos'
  332.  
  333. DIRECTORY ='/uploads/'
  334.  
  335. ### Configuracion FileBrowser
  336. FILEBROWSER_EXTENSIONS = {
  337.     #'Folder': [''],
  338.     'Image': ['.jpg','.jpeg','.gif','.png'],
  339.     'Document': ['.pdf','.doc',],
  340.     'Compress': ['.zip', ],
  341.  
  342.     #'Video': ['.mov','.wmv','.mpeg','.mpg','.avi','.rm'],
  343.     #'Audio': ['.mp3','.mp4','.wav','.aiff','.midi','.m4p']
  344. }
  345.  
  346. FILEBROWSER_SELECT_FORMATS =  {
  347.     'image': ['Image'],
  348.     'document': ['Document'],
  349.     #'media': ['Video','Audio'],
  350. }
  351.  
  352. REMESAS_EXT =  ['.mr5', '.txt']
  353.  
  354.  
  355. PATH_ADJUNTOS = {
  356.                     'INSCRIPCION': os.path.join(  ( '%s/uploads/files/inscripcion' % MEDIA_ROOT )),
  357.                     'MATRICULA': os.path.join(  ( '%s/uploads/files/matricula' % MEDIA_ROOT )),
  358.                     'ESTIMULOS': os.path.join(  ( '%s/uploads/files/estimulos' % MEDIA_ROOT )),
  359.                     'VOTACION': os.path.join(  ( '%s/uploads/votacion' % MEDIA_ROOT )),
  360.                     'ACTAS': os.path.join(  ( '%s/uploads/actas' % MEDIA_ROOT )),
  361.                     'CARNET': os.path.join(  ( '%s/uploads/carnet' % MEDIA_ROOT )),
  362.                   }
  363.  
  364. FILEBROWSER_VERSIONS_BASEDIR = '_versions/'
  365. FILEBROWSER_VERSIONS = {
  366.     'admin_thumbnail': {'verbose_name': 'Admin Thumbnail', 'width': 60, 'height': 60, 'opts': 'crop'},
  367.     'thumbnail': {'verbose_name': 'Thumbnail (1 col)', 'width': 50, 'height': 50, 'opts': 'crop'},
  368.     'small': {'verbose_name': 'Small (2 col)', 'width': 140, 'height': '', 'opts': ''},
  369.     'medium': {'verbose_name': 'Medium (4col )', 'width': 300, 'height': '', 'opts': ''},
  370.     #'big': {'verbose_name': 'Big (6 col)', 'width': 460, 'height': '', 'opts': ''},
  371.     #'large': {'verbose_name': 'Large (8 col)', 'width': 680, 'height': '', 'opts': ''},
  372.    
  373. }
  374.  
  375. FILEBROWSER_VERSION_QUALITY = 90
  376. FILEBROWSER_ADMIN_VERSIONS = ['small', 'admin_thumbnail',]
  377. FILEBROWSER_ADMIN_THUMBNAIL = 'admin_thumbnail'
  378. FILEBROWSER_PLACEHOLDER = '' # Ruta de la image (esta es relativa a la ruta de almacenamiento)
  379. FILEBROWSER_SHOW_PLACEHOLDER = False # Si la imagen original no existe
  380. FILEBROWSER_FORCE_PLACEHOLDER = False
  381. FILEBROWSER_MAX_UPLOAD_SIZE = 1048576 # Tamaño en bytes
  382. FILEBROWSER_NORMALIZE_FILENAME = True # normalizar los filename cuando son subidos y remover los caracteres no alfabumericos
  383. FILEBROWSER_DEFAULT_PERMISSIONS = 0755
  384. FILEBROWSER_OVERWRITE_EXISTING =  True
  385.  
  386. #PHOTO_PATH = RYCA_PATH + '/ryca/static/img'
  387.  
  388. # Absolute path to the directory static files should be collected to.
  389. # Don't put anything in this directory yourself; store your static files
  390. # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  391. # Example: "/var/www/example.com/static/"
  392. STATIC_ROOT = ''
  393.  
  394. # URL prefix for static files.
  395. # Example: "http://example.com/static/", "http://static.example.com/"
  396. STATIC_URL = '/static/'
  397.  
  398. # Additional locations of static files
  399. STATICFILES_DIRS = (
  400.     # Put strings here, like "/home/html/static" or "C:/www/django/static".
  401.     # Always use forward slashes, even on Windows.
  402.     # Don't forget to use absolute paths, not relative paths.
  403.      os.path.join(  ( '%s/ryca/static' % RYCA_PATH )),
  404. )
  405.  
  406. # List of finder classes that know how to find static files in
  407. # various locations.
  408. STATICFILES_FINDERS = (
  409.     'django.contrib.staticfiles.finders.FileSystemFinder',
  410.     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  411. #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
  412. )
  413.  
  414. FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler",
  415.                         "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
  416.  
  417. # Make this unique, and don't share it with anybody.
  418. SECRET_KEY = 'ln61y5!d%4hoffb@*kz#3*k$!-6#ed$l#lkopy9&l#&w@0k1c!'
  419.  
  420. # List of callables that know how to import templates from various sources.
  421. TEMPLATE_LOADERS = (
  422.     'django.template.loaders.filesystem.Loader',
  423.     'django.template.loaders.app_directories.Loader',
  424. #     'django.template.loaders.eggs.Loader',
  425. )
  426.  
  427. AUTHENTICATION_BACKENDS = (
  428.     'oauth2_provider.backends.OAuth2Backend',
  429.     'django.contrib.auth.backends.ModelBackend',
  430. )
  431.  
  432.  
  433. MIDDLEWARE_CLASSES = (
  434.    
  435.     'django.middleware.common.CommonMiddleware',
  436.     'django.middleware.csrf.CsrfViewMiddleware',
  437.     'django.contrib.sessions.middleware.SessionMiddleware',
  438.     'django.contrib.auth.middleware.AuthenticationMiddleware',
  439.     'django.contrib.messages.middleware.MessageMiddleware',
  440.     'ryca.middleware.session.Sesion',
  441.     'ryca.middleware.filebrowser.FileBrowser',
  442.     'corsheaders.middleware.CorsMiddleware',
  443.     'debug_toolbar.middleware.DebugToolbarMiddleware',
  444.  
  445.     # Uncomment the next line for simple clickjacking protection:
  446.     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  447. )
  448.  
  449.  
  450. ROOT_URLCONF = 'ryca.urls'
  451.  
  452. # Python dotted path to the WSGI application used by Django's runserver.
  453. WSGI_APPLICATION = 'ryca.wsgi.application'
  454.  
  455. # Procesador de contexto carga manual
  456. TEMPLATE_CONTEXT_PROCESSORS = (
  457.     'django.contrib.auth.context_processors.auth',
  458.     'django.core.context_processors.debug',
  459.     'django.core.context_processors.i18n',
  460.     'ryca.context_processors.ryca',
  461.     'django.core.context_processors.request',
  462.    
  463. )
  464.  
  465. TEMPLATE_DIRS = (
  466.     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
  467.     # Always use forward slashes, even on Windows.
  468.     # Don't forget to use absolute paths, not relative paths.
  469.     os.path.join(  ( '%s/ryca/templates' % RYCA_PATH )),
  470. )
  471.  
  472. DJANGO_APPS = (
  473.     'django.contrib.auth',
  474.     'django.contrib.contenttypes',
  475.     'django.contrib.sessions',
  476.     'django.contrib.sites',
  477.     'django.contrib.messages',
  478.     'django.contrib.staticfiles',
  479.     'debug_toolbar',
  480.     'django.contrib.humanize',
  481.      #Admin
  482.      #'django_admin_bootstrapped.bootstrap3',
  483.     'django_admin_bootstrapped',
  484.     'django.contrib.admin',
  485.     )
  486.  
  487. THIRD_PARTY_APPS = (
  488.     'smart_selects',
  489.     'autocomplete_light',
  490.     'captcha',
  491.     'widget_tweaks',
  492.     'filebrowser',
  493.     'django_bootstrap_calendar',
  494.     'djcelery',
  495.     'corsheaders',
  496.     'webcam',
  497.     'storages',
  498.     #'channels',
  499.     )
  500.  
  501. PROJECT_APPS = (
  502.     'academicos',
  503.     'admisiones',
  504.     'bienestar',
  505.     'calendario_academico',
  506.     'calificacion_docente',
  507.     'cpanel',
  508.     'cursos',
  509.     'estudiantes',
  510.     'financiera',
  511.     'graduados',
  512.     'matriculas',
  513.     'educacion_noformal',
  514.     'profesores',
  515.     'usuarios',
  516.     'servicios',
  517.     'notas',
  518.     'reportes',
  519.     'oauth2_provider',
  520.     'rest_framework',
  521. )
  522.  
  523. INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + PROJECT_APPS + ('ryca',)
  524.  
  525. # A sample logging configuration. The only tangible logging
  526. # performed by this configuration is to send an email to
  527. # the site admins on every HTTP 500 error when DEBUG=False.
  528. # See http://docs.djangoproject.com/en/dev/topics/logging for
  529. # more details on how to customize your logging configuration.
  530. LOGGING = {
  531.     'version': 1,
  532.     'disable_existing_loggers': False,
  533.     'filters': {
  534.         'require_debug_false': {
  535.             '()': 'django.utils.log.RequireDebugFalse'
  536.         }
  537.     },
  538.     'handlers': {
  539.         'mail_admins': {
  540.             'level': 'ERROR',
  541.             'filters': ['require_debug_false'],
  542.             'class': 'django.utils.log.AdminEmailHandler'
  543.         }
  544.     },
  545.     'loggers': {
  546.         'django.request': {
  547.             'handlers': ['mail_admins'],
  548.             'level': 'ERROR',
  549.             'propagate': True,
  550.         },
  551.     }
  552. }
  553.  
  554.  
  555. RECAPTCHA_PUBLIC_KEY = '6Le37EUUAAAAANC5NhqXfzhhmF7n8dk-8ma-2nr-'
  556. RECAPTCHA_PRIVATE_KEY = '6Le37EUUAAAAAKoPkIWmv22DvzVUWkmxuse6lf1E'
  557. NOCAPTCHA = True
  558. RECAPTCHA_USE_SSL = False
  559.  
  560.  
  561.  
  562. ## Configuracion Celery
  563.  
  564. #BROKER_URL = 'amqp://guest:guest@192.168.11.79//'
  565.  
  566. BROKER_HOST = os.environ.get('BROKER_HOST', 'localhost')
  567. BROKER_PORT = os.environ.get('BROKER_PORT', '5672')
  568. BROKER_USER = os.environ.get('BROKER_USER', '')
  569. BROKER_PASSWORD = os.environ.get('BROKER_PASSWORD', '')
  570. BROKER_VHOST = "/"
  571.  
  572. # Configuración de colas
  573. #CELERY_QUEUES = (
  574. #    Queue('my_queue', routing_key='my_queue'),
  575. #)
  576. # Configuración de número de workers (Por defect5)
  577. CELERY_CONCURRENCY = 5
  578. CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend'
  579. CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
  580. CELERY_IMPORTS = ("academicos.task", "calendario_academico.task", "admisiones.task", "ryca.task" )
  581.  
  582.  
  583. # Cargamos celery y lo cargamos
  584. import djcelery
  585. djcelery.setup_loader()
  586.  
  587. #TODO: API REST FULL y OAUTH
  588.  
  589. #FixME: verificar  en modo produccion
  590. CORS_ORIGIN_ALLOW_ALL = True
  591. """
  592. REST_FRAMEWORK = {
  593.    'DEFAULT_AUTHENTICATION_CLASSES': (
  594.        'oauth2_provider.ext.rest_framework.OAuth2Authentication',
  595.    )
  596. }"""
  597.  
  598.  
  599. OAUTH2_PROVIDER = {
  600.     # this is the list of available scopes
  601.     'SCOPES': {'read': 'Read scope', 'write': 'Write scope', 'groups': 'Access to your groups'}
  602. }
  603.  
  604.  
  605. ##### Acceso a Twitter
  606. TWITTER = {
  607.            'API_KEY' : 'H39nqZ4YCW6qmju8xm9GOUuPH',
  608.            'API_SECRET': 'aYZxP5MDhTRk7Fr7Um2TdPLdu8Z7CabD6fGLgzO9yBcWuYW3hp',
  609.            'ACCESS_TOKEN': '2791214514-j133RzN0sq6oFsm74NMR9qKhRWGjB6qTDLGIsbX',
  610.            'TOKEN_SECRET': 'rZlH4WRoUosJe9oCr7yCjYb1PPqjiRczU0pTmBkXxVqZy',
  611.            'IES_ACCOUNT': 'Itfip',
  612. }
  613.  
  614.  
  615. ## HOST
  616. DOMAIN = 'http://plataformaryca.itfip.edu.co'
  617.  
  618.  
  619. MONGODB_DATABASES = {
  620.     "default": {
  621.         "name": os.environ.get('MONGO_DB_NAME', ''),
  622.         "host": os.environ.get('MONGO_DB_HOST', ''),
  623.         "username": os.environ.get('MONGO_DB_USER', ''),
  624.         "password": os.environ.get('MONGO_DB_PASSWORD', ''),
  625.         "tz_aware": True, # if you using timezones in django (USE_TZ = True)
  626.     },
  627. }
  628.  
  629. INSTALLED_APPS += ("django_mongoengine", )
  630.  
  631. #STATICFILES_STORAGE = 'storages.backends.sftpstorage.SFTPStorage'
  632. # DEFAULT_FILE_STORAGE = 'storages.backends.sftpstorage.SFTPStorage'
  633. SFTP_STORAGE_HOST = '192.168.11.79'
  634. SFTP_STORAGE_ROOT = '/home/desarrollo/media/'
  635. SFTP_STORAGE_PARAMS = {
  636.                       "port": 22 ,
  637.                       "username": 'desarrollo',
  638.                       "password": 'd3sarroll0abc*'
  639.                       }
  640. # SFTP_STORAGE_FILE_MODE =
  641. # SFTP_STORAGE_DIR_MODE =
  642.  
  643.  
  644. """
  645. CHANNEL_LAYERS = {
  646.    "default": {
  647.        "BACKEND": "asgi_redis.RedisChannelLayer",
  648.        "CONFIG": {
  649.            "hosts": [("localhost", 6379)],
  650.        },
  651.        "ROUTING": "ryca.routing.channel_routing",
  652.    },
  653. }
  654. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement