Index: .gitignore
===================================================================
--- .gitignore	(revision bf475917c09d88f08785ab64628b3b984facb248)
+++ .gitignore	(revision a4764f93921a5e9b2641533c82998fcf2025861e)
@@ -14,4 +14,10 @@
 eventos/migrations
 participantes/migrations
+sources/tmp/*.pdf
+sources/tmp/*.jpg
+sources/tmp/*.tmp
+sources/tmp/*.png
+sources/tmp/*.bmp
+sources/tmp/*.*~
 *.*.backup
 *.*~
Index: FirmaEventos/default.settings.py
===================================================================
--- FirmaEventos/default.settings.py	(revision 3397a086dfd079cbd9c48c247d63eaf7a5a8c18d)
+++ FirmaEventos/default.settings.py	(revision a4764f93921a5e9b2641533c82998fcf2025861e)
@@ -94,5 +94,5 @@
         'NAME': 'firma_eventos',
         'USER': 'postgres',
-        'PASSWORD': '123456',
+        'PASSWORD': 'postgres',
         'HOST': 'localhost',
         'PORT': '5432',
@@ -139,4 +139,6 @@
 MEDIA_URL = '/sources/'
 
+TMP = os.path.join(MEDIA_ROOT, 'tmp')
+
 # Static files (CSS, JavaScript, Images)
 # https://docs.djangoproject.com/en/1.8/howto/static-files/
@@ -154,5 +156,5 @@
 # Configuración para el logeo de usuarios
 
-LOGIN_URL = "/"
+LOGIN_URL = "/login"
 
 LOGOUT_URL= "/logout"
Index: eventos/forms.py
===================================================================
--- eventos/forms.py	(revision d3c0ab7dab0f65bb9bebb0d87a2e08d8446fae8f)
+++ eventos/forms.py	(revision a4764f93921a5e9b2641533c82998fcf2025861e)
@@ -42,5 +42,6 @@
         self.fields['archivo'].widget.attrs.update(
             {'class': 'file-path validate',
-             'placeholder': 'Subir Archivo'})
+             'placeholder': 'Subir Archivo',
+             'accept': '.pdf'})
 
 class FirmaEventoForm(forms.Form):
@@ -53,4 +54,3 @@
     @version 1.0.0
     """
-    
     pasaporte = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'Ingrese su pasaporte'}))
Index: eventos/models.py
===================================================================
--- eventos/models.py	(revision 5dea5ffa4f48a80cb029664f42ace3fd7dfa3fe4)
+++ eventos/models.py	(revision a4764f93921a5e9b2641533c82998fcf2025861e)
@@ -13,5 +13,5 @@
     nombre_evento = models.CharField(max_length=128, unique=True)
     fecha = models.DateField(null=False)
-    serial = models.IntegerField(unique=True)
+    serial = models.CharField(max_length=128, unique=True)
     activo = models.BooleanField(default=True)
 
Index: eventos/templates/register.event.html
===================================================================
--- eventos/templates/register.event.html	(revision 94b3e3ff310d164bbe6933e5c3b3d7ec792dcd91)
+++ eventos/templates/register.event.html	(revision a4764f93921a5e9b2641533c82998fcf2025861e)
@@ -11,6 +11,9 @@
             // Django appears to generate the prefix from the lowercase plural
             // name of the related model, with camel-case converted to underscores.
-            prefix: 'form'
+            prefix: 'form',
+            addText:'<i class="tiny material-icons prefix">add_circle_outline</i>Agregar Participante',
+            deleteText:'<i class="material-icons">delete_forever</i>',
         })
+
           $('.datepicker').pickadate({
             selectMonths: true, // Creates a dropdown to control month
@@ -21,4 +24,25 @@
             closeOnSelect: false, // Close upon selecting a date,
             format: "dd/mm/yyyy",
+            // The title label to use for the month nav buttons
+            labelMonthNext: 'Mes siguiente',
+            labelMonthPrev: 'Mes anterior',
+
+            // The title label to use for the dropdown selectors
+            labelMonthSelect: 'Selecciona un mes',
+            labelYearSelect: 'Selecciona un año',
+
+            // Months and weekdays
+            monthsFull: [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ],
+            monthsShort: [ 'Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic' ],
+            weekdaysFull: [ 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado' ],
+            weekdaysShort: [ 'Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab' ],
+
+            // Materialize modified
+            weekdaysLetter: [ 'D', 'L', 'M', 'Mi', 'J', 'V', 'S' ],
+
+            // Today and clear
+            today: 'Hoy',
+            clear: 'Limpiar',
+            close: 'Ok',
           });
     })
@@ -29,5 +53,5 @@
     <div class="content center">
         <h5>Datos del Evento</h5><hr/><br>
-        <form id="form" method="post">
+        <form id="form" method="post" enctype="multipart/form-data">
             {% csrf_token %}
             <div class="input-field {% if form.nombre_evento.errors %}invalid{% endif %}">
@@ -48,5 +72,5 @@
                 <div class="btn">
                 <span for="icon_prefix {{ form.archivo.auto_id }}">Archivo</span>
-                    <input type="file">
+                    <input type="file" name="file" id="file" accept=".pdf">
                 </div>
                 <div class="file-path-wrapper">
Index: eventos/views.py
===================================================================
--- eventos/views.py	(revision b8fffffdb533b68ea9eca466f947c3fa72e81e4c)
+++ eventos/views.py	(revision a4764f93921a5e9b2641533c82998fcf2025861e)
@@ -1,8 +1,14 @@
-import random 
+# -*- encoding: utf-8 -*-
+
+import os
+import requests
+from django.conf import settings
 from django.contrib import messages
 from django.contrib.auth.mixins import LoginRequiredMixin
+from django.core.files.base import ContentFile
+from django.core.files.storage import default_storage
 from django.core.urlresolvers import reverse_lazy
 from django.shortcuts import (
-    render, redirect, get_object_or_404
+    redirect
 )
 from django.views.generic import ListView, FormView
@@ -19,4 +25,9 @@
 )
 
+
+def handle_uploaded_file(file, name):
+    with open('%s/%s' % (settings.TMP, name), 'wb+') as destination:
+        for chunk in file.chunks():
+            destination.write(chunk)
 
 class RegisterEvent(LoginRequiredMixin, FormView):
@@ -44,35 +55,54 @@
 
     def post(self, request, *args, **kwargs):
-        nuevo_evento = self.form_class(request.POST).save(commit=False)
-        nuevo_participante = self.form_participante(request.POST)
-        consulta_api = random.randrange(0, 500)
-        if self.form_class(request.POST).is_valid() and nuevo_participante.is_valid():
-            nuevo_evento.serial = consulta_api
-            nuevo_evento.save()
-            #nuevo_participante.save()
-            # Control para guardar y asignar participante al evento
-            for form in nuevo_participante:
-                if form.cleaned_data.get('DELETE') and form.instance.pk:
-                    form.instance.delete()
-                else:
-                    instance = form.save(commit=False)
-                    parametros = {
-                                    'nombres': instance.nombres,
-                                    'apellidos': instance.apellidos,
-                                    'correo': instance.correo
-                                    }
-                    nuevo_participante, create= Participante.objects.update_or_create(pasaporte=instance.pasaporte, defaults=parametros)
-                    #instance.save()
-                    asigna_evento = ParticipanteEvento(fk_participante=nuevo_participante,
-                                                    fk_evento=nuevo_evento)
-                    print(asigna_evento.pk)
-                    asigna_evento.save()
-            messages.success(self.request, "El usaurio %s, ha creado con exito,\
-                                        un nuevo envento %s" %
-                         (str(self.request.user),
-                          str(nuevo_evento)))
-        else:
-            messages.error(self.request, "Existe un error en el Formualario %s" %
-                         (str(self.form_class.errors, self.form_participante.errors)))
+        nuevo_evento = self.form_class(request.POST, request.FILES).save(commit=False)
+        file =  request.FILES['file']
+        handle_uploaded_file(request.FILES['file'], file)
+        ruta = '%s/%s' % (settings.TMP, file)
+        files = {'file': open(ruta, 'rb')}
+        try:
+            r = requests.post('https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/cargar', verify=False, headers={'Authorization': 'Basic YWRtaW46YWRtaW4='}, files=files)
+            nuevo_participante = self.form_participante(request.POST)
+            consulta_api = r.json()['fileId']
+            # elimina el archivo si fue creado en la carpeta tmp
+            os.unlink(ruta)
+        except Exception as e:
+            print (e)
+            messages.error(self.request, "Error al concetar al servidor y subir\
+                                          el archivo a la api Murachi")
+            return redirect(self.success_url)
+        try:
+            if self.form_class(request.POST).is_valid() and nuevo_participante.is_valid():
+                nuevo_evento.serial = consulta_api
+                nuevo_evento.save()
+                # Control para guardar y asignar participantes al evento
+                for form in nuevo_participante:
+                    if form.cleaned_data.get('DELETE') and form.instance.pk:
+                        form.instance.delete()
+                    else:
+                        instance = form.save(commit=False)
+                        parametros = {
+                                        'nombres': instance.nombres,
+                                        'apellidos': instance.apellidos,
+                                        'correo': instance.correo
+                                        }
+                        nuevo_participante, create = Participante.objects.update_or_create(pasaporte=instance.pasaporte, defaults=parametros)
+                        asigna_evento = ParticipanteEvento(
+                                        fk_participante=nuevo_participante,
+                                        fk_evento=nuevo_evento)
+                        asigna_evento.save()
+                messages.success(self.request, "El usaurio %s, ha creado con exito,\
+                                            un nuevo envento %s" %
+                                 (str(self.request.user),
+                                  str(nuevo_evento)))
+            else:
+                messages.error(self.request, "Existe un error en el\
+                                              Formualario %s %s" %
+                               (self.form_class(request.POST).errors,
+                                self.form_participante(request.POST).errors))
+        except Exception as e:
+            print (e)
+            messages.error(self.request, "Esta intentado realizar una\
+                                          accion incorrecta")
+
         return redirect(self.success_url)
 
Index: users/views.py
===================================================================
--- users/views.py	(revision 5dea5ffa4f48a80cb029664f42ace3fd7dfa3fe4)
+++ users/views.py	(revision a4764f93921a5e9b2641533c82998fcf2025861e)
@@ -62,5 +62,14 @@
         usuario = form.cleaned_data['usuario']
         contrasena = form.cleaned_data['contrasena']
-        
+        try:
+            validate_email(usuario)
+            try:
+                usuario = User.objects.get(email=usuario).username
+            except:
+                messages.error(self.request, 'No existe este correo: %s \
+                                              asociado a una cuenta' % (usuario))
+        except Exception as e:
+            print (e)
+
         usuario = authenticate(username=usuario, password=contrasena)
         if usuario is not None:
