[pyar] problema con static en django

Antonio Gastón Barbetta a.g.barbetta en gmail.com
Lun Abr 17 11:25:33 ART 2017


daniel, yo me fije en codigo de pag y de ahi salta el error si es a eso lo
que te referis y estoy usando el servidor de desarrollo de django

andres, paso el include, el archivo js carga

<script type="text/javascript" scr="{% static 'notas/js/animaciones.js'
%}"></script>

muchas gracias

2017-04-17 11:12 GMT-03:00 Andrés Ramírez <andres.ramirez.miori en gmail.com>:

> hay que ver si esta sirviendo el archivo js, faltaria ver como haces el
> include y si cuando servís la página se esta bajando el mismo
>
> On Mon, Apr 17, 2017 at 11:09 AM, Daniel <dmlistapython en gmail.com> wrote:
>
>> probá de cargar "a mano" la url que te genera el template, es decir mirá
>> el código de la página generada y fijate si te lo está sirviendo en el
>> lugar donde esperás.
>>
>> ¿estas usando el servidor de desarrollo de django?
>>
>> 2017-04-17 11:07 GMT-03:00 Antonio Gastón Barbetta <
>> a.g.barbetta en gmail.com>:
>>
>>> el js:
>>>
>>>
>>> function animacion(numero) {
>>> switch (numero){
>>> case 1:
>>> document.getElementById('home_nav').style.fontSize = 30;
>>> document.getElementById('home_nav').style.borderBottom = "solid 3px
>>> #F6CEF5";
>>> document.getElementById('notas_nav').style.fontSize = 20;
>>> document.getElementById('notas_nav').style.borderBottom = "solid 0px
>>> #CEF6CE";
>>> document.getElementById('hola_nav').style.fontSize = 20;
>>> document.getElementById('hola_nav').style.borderBottom = "solid 0px
>>> #F2F5A9";
>>> document.getElementById('viaje_nav').style.fontSize = 20;
>>> document.getElementById('viaje_nav').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> document.getElementById('contacto_nav').style.fontSize = 20;
>>> document.getElementById('contacto_nav').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> break;
>>> case 2:
>>> document.getElementById('hola_menu').style.fontSize = 20;
>>> document.getElementById('hola_menu').style.borderBottom = "solid 0px
>>> #F6CEF5";
>>> document.getElementById('fotos_menu').style.fontSize = 30;
>>> document.getElementById('fotos_menu').style.borderBottom = "solid 3px
>>> #CEF6CE";
>>> document.getElementById('notas_menu').style.fontSize = 20;
>>> document.getElementById('notas_menu').style.borderBottom = "solid 0px
>>> #F3F781";
>>> document.getElementById('viaje_menu').style.fontSize = 20;
>>> document.getElementById('viaje_menu').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> document.getElementById('contacto_nav').style.fontSize = 20;
>>> document.getElementById('contacto_nav').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> break;
>>> case 3:
>>> document.getElementById('hola_menu').style.fontSize = 20;
>>> document.getElementById('hola_menu').style.borderBottom = "solid 0px
>>> #F6CEF5";
>>> document.getElementById('fotos_menu').style.fontSize = 20;
>>> document.getElementById('fotos_menu').style.borderBottom = "solid 0px
>>> #CEF6CE";
>>> document.getElementById('notas_menu').style.fontSize = 30;
>>> document.getElementById('notas_menu').style.borderBottom = "solid 3px
>>> #F2F5A9";
>>> document.getElementById('viaje_menu').style.fontSize = 20;
>>> document.getElementById('viaje_menu').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> document.getElementById('contacto_nav').style.fontSize = 20;
>>> document.getElementById('contacto_nav').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> break;
>>>
>>> case 4:
>>> document.getElementById('hola_menu').style.fontSize = 20;
>>> document.getElementById('hola_menu').style.borderBottom = "solid 0px
>>> #F6CEF5";
>>> document.getElementById('fotos_menu').style.fontSize = 20;
>>> document.getElementById('fotos_menu').style.borderBottom = "solid 0px
>>> #CEF6CE";
>>> document.getElementById('notas_menu').style.fontSize = 20;
>>> document.getElementById('notas_menu').style.borderBottom = "solid 0px
>>> #F2F5A9";
>>> document.getElementById('viaje_menu').style.fontSize = 30;
>>> document.getElementById('viaje_menu').style.borderBottom = "solid 3px
>>> #CED8F6";
>>> document.getElementById('contacto_nav').style.fontSize = 20;
>>> document.getElementById('contacto_nav').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> break;
>>>
>>> case 5:
>>> document.getElementById('hola_menu').style.fontSize = 20;
>>> document.getElementById('hola_menu').style.borderBottom = "solid 0px
>>> #F6CEF5";
>>> document.getElementById('fotos_menu').style.fontSize = 20;
>>> document.getElementById('fotos_menu').style.borderBottom = "solid 0px
>>> #CEF6CE";
>>> document.getElementById('notas_menu').style.fontSize = 20;
>>> document.getElementById('notas_menu').style.borderBottom = "solid 0px
>>> #F2F5A9";
>>> document.getElementById('viaje_menu').style.fontSize = 20;
>>> document.getElementById('viaje_menu').style.borderBottom = "solid 3px
>>> #CED8F6";
>>> document.getElementById('contacto_nav').style.fontSize = 30;
>>> document.getElementById('contacto_nav').style.borderBottom = "solid 0px
>>> #CED8F6";
>>> break;
>>> }
>>> }
>>>
>>>
>>> alugno me podra ayudar? en setings.py tengo configurado los static y el
>>> error que me salga es el sig. Uncaught ReferenceError: animacion_menu is
>>> not defined
>>>     at HTMLAnchorElement.onmouseover ((index):30)
>>>
>>>
>>> El 17 de abril de 2017, 11:04, Antonio Gastón Barbetta <
>>> a.g.barbetta en gmail.com> escribió:
>>>
>>>> hola que tal?
>>>>
>>>> estoy teniendo un problema con un js. donde me tira que la fucnion del
>>>> archivo js no esta definida.
>>>>
>>>> les pongo las partes del codigo:
>>>>
>>>> el html:
>>>>
>>>>
>>>>
>>>> <nav class= "navegacion">
>>>> <ul>
>>>> <li><a href="/Home" class="link_nav" id="home_nav"
>>>> onmouseover="animacion(1)">Home</a></li>
>>>> <li><a href="/Notas/Todas" class="link_nav" id="notas_nav"
>>>> onmouseover="animacion_menu(2)">Notas</a></li>
>>>> <li><a href="/Hola" class="link_nav" id="hola_nav"
>>>> onmouseover="animacion_menu(3)">¡Hola!</a></li>
>>>> <li><a href="/Viaje-por-el-universo" class="link_nav" id="viaje_nav"
>>>> onmouseover="animacion_menu(4)">Viaje por el universo</a></li>
>>>> <li><a href="/Contacto/Dejanos-tu-mensaje" class="link_nav"
>>>> id="contacto_nav" onmouseover="animacion_menu(5)">Contacto</a></li>
>>>> </ul>
>>>> </nav>
>>>>
>>>>
>>>>
>>>> el js:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>>
>>
>> --
>> Daniel Malisani
>>
>> _______________________________________________
>> 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
>>
>
>
> _______________________________________________
> 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
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20170417/f4c8b489/attachment-0001.html>


Más información sobre la lista de distribución pyar