a little bit of jazz with django
DESCRIPTION
Guía para la sesión de trabajo sobre proyectos web basados en el framework Django.TRANSCRIPT
![Page 1: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/1.jpg)
A little bit of jazz with Django
![Page 3: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/3.jpg)
Django
- Framework web de código abierto.- Escrito en Python.- Aplicaciones web ágiles y con menos código.- Licencia BSD.
Django
![Page 4: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/4.jpg)
Principios
- Desarrollos extremadamente rápidos.- Conseguir funcionalidades sin atarte.- Bajo acoplamiento entre partes.- DRY (Don't repeat yourself).
Django
![Page 5: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/5.jpg)
Características
- Basado en el lenguaje de programación Python.- Disponibilidad de mapeo objeto-relacionacional.- Interfaces de administración.- Posibilidad de URLs limpias.- Sistema de plantillas.- Integración con sistemas caché.- Soporte multilenguaje para I18n- MVC
Django
![Page 6: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/6.jpg)
Componentes
- ORM.- URL Dispatcher.- Session.- Auth.- Cache- I18n- Flatpages- Redirects- CSRF-GeoDjango
Django
![Page 7: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/7.jpg)
Admin
django-admin.py para linea de comandos y manage.py como wraper “ligero” para el anterior.
- Syncdb.- Shell y dbshell.- Test- Loaddata – Dumpdata-Runserver
Django
![Page 8: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/8.jpg)
Claves
- Abstracción de la base de datos (ORM).- SQL creado automático.- Control de inyección SQL.- Automatización mediante scripts.- Capas separadas. - Permite uso VCS.
Django
![Page 9: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/9.jpg)
Claves
Basado en lenguaje Python:- Interpretado.- Intuitivo.- Multiparadigma.- Multiplataforma. - ¿Minimalista?
Django
![Page 10: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/10.jpg)
Claves
def load_names(path):names = {}file = open(path)for line in file.read(): url, name = line.split(':') names[url] = name.strip()return comics+print “Hola mundo” ¬¬
Django
![Page 11: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/11.jpg)
Proyecto
$ django-admin.py startproject newproject
$ ls newproject/_init_.py manage.py settings.py urls.py
$ python manage.py runserver
http://localhost:8000
Problem?
Django
![Page 12: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/12.jpg)
Archivos
_init.py_
manage.py
settings.py
urls.py
Django
![Page 13: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/13.jpg)
Memcached$ apt - get install memcached$ apt – get install python-memcache
BACKENDdjango.core.cache.backends.memcached.MemcachedCache django.core.cache.backends.memcached.PyLibMCCache
LOCATIONip:portunix:path
Django
![Page 14: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/14.jpg)
Memcached
python manage.py createcachetable [cache_table]CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.db.DatabaseCache', 'LOCATION': 'cache_table', }}
Django
![Page 15: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/15.jpg)
Django
![Page 16: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/16.jpg)
Django
![Page 17: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/17.jpg)
Django
![Page 18: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/18.jpg)
Ejemplos
PinterestInstagrambitbucketsupport.mozilla.comaddons.mozilla.orgThe OnionGiantBombMichaelMoore.com
Django
![Page 19: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/19.jpg)
Recursos
https://docs.djangoproject.com/en/dev/ref/django-admin/
http://www.djangobook.com/en/2.0/index.html
http://djangosnippets.org/
Django
![Page 20: A little bit of jazz with Django](https://reader033.vdocuments.site/reader033/viewer/2022052321/54812b87b4af9fce158b5e7d/html5/thumbnails/20.jpg)
¿Preguntas?