{% extends "base.html" %}
{% block title %}Inicio{% endblock %}
{% block js_code %}
<script type="text/javascript">
$(document).ready(function(){
  $("#id_username").focus();

  $("#id_username").bind('keyup', function (e) {
      if (e.which >= 97 && e.which <= 122) {
          var newKey = e.which - 32;
          // I have tried setting those
          e.keyCode = newKey;
          e.charCode = newKey;
      }

      $("#id_username").val(($("#id_username").val()).toUpperCase());
  });
});
</script>    

{% endblock %}
{% block content %}
<header>
  <br>
  <h1 class="text-center hidden-phone">Iniciar sesión</h1>
  <br>
</header>
<div class="row">
    <div class="col-md-2 col-md-offset-5">
      <form  role="form" action="/login/" method="post">{% csrf_token %}
        {{ form.errors }} 
        <div class="form-group">
          <label for="username_id">Conexión</label>
          {{ form.conexion_db }}
        </div>
        <div class="form-group">
          <label for="username_id">Usuario</label>
          {{ form.username }}
        </div>
        <div class="form-group">
          <label for ="password_id">Contraseña</label>
          {{ form.password }} 
        </div>
        <input class="btn" type="submit" value="Ingresar" id="submit" />
      </form>
    </div>
</div>
<p style="color:red;">{{ message }}</p>
<br><br>
      <br><br><br><br><br>
<br><br><br><br><br>	
{% endblock %}