[pyar] [DJANGO] Auth y Bootstrap

Angel Freire cuerty en gmail.com
Jue Abr 17 23:51:40 ART 2014


2014-04-17 22:11 GMT-03:00 Jose Pron <josepron en gmail.com>:

> Hola tengo una duda, quiero agregarle bootstrap a un template que utilizo
> para loggearme con auth en mi aplicacion.
> para un imputbox bootstrap me da el siguiente codigo
>
> <div class="input-group">
>   <span class="input-group-addon">@</span>
>   <input type="text" class="form-control" placeholder="Username"></div>
>
>
>
>
> pero para el html del login utilizo lo siguiente
>
> <form method="post" action="{% url 'django.contrib.auth.views.login' %}">
>     {% csrf_token %}
>     <table>
>     <tr>
>       <td>{{ form.username.label_tag }}</td>
>       <td>{{ form.username }}</td>
>     </tr>
>     <tr>
>       <td>{{ form.password.label_tag }}</td>
>       <td>{{ form.password }}</td>
>     </tr>
>     </table>
>
>     <input type="submit" value="login" />
>     <input type="hidden" name="next" value="{{ next }}" />
>     </form>
>
> alguien lo hizo alguna vez como para guiarme un poco?
>
> --
> Saludos, José Pron.
>
> _______________________________________________
> pyar mailing list pyar en python.org.ar
> http://listas.python.org.ar/listinfo/pyar
>
> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>
> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>

Si queres manipular a fondo como se renderiza el formulario te recomiendo
mirar floppyforms [0].

En particular las secciones de Customization y Form layouts. Eso te va a
permitir tener tu propio template para definir como se deberia renderizar
form.username y form.password, y tambien uno general del form (el layout).

[0] http://django-floppyforms.readthedocs.org/

-- 
http://blog.cuerty.com

"If you want to set off and go develop some grand new thing, you don't need
millions of dollars of capitalization. You need enough pizza and Diet Coke
to stick in your refrigerator, a cheap PC to work on and the dedication to
go through with it."
- John Carmack
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20140417/7a58b238/attachment-0001.html>


More information about the pyar mailing list