Welcome to the Django

2,099 views

Published on

Slides da palestra Welcome to the Django apresentada na Latinoware 2009.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,099
On SlideShare
0
From Embeds
0
Number of Embeds
30
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Welcome to the Django

  1. 1. “Idade da Pedra”
  2. 2. “Idade do Bronze”
  3. 3. “Idade do Ferro”
  4. 4. PHP is the devil.
  5. 5. Orientado a Páginas
  6. 6. Frameworks “Revolução Industrial”
  7. 7. MVC?
  8. 8. class Categoria(models.Model): nome = models.CharField(max_length=20) class Noticia(models.Model): titulo = models.CharField(max_length=30) conteudo = models.TextField() data = models.DateTimeField() categoria = models.ManyToManyField(Categoria)
  9. 9. def lista_noticias(request): noticias = Noticia.objects.all().order_by(‘data’) return render_to_response( ‘noticias.html’, {‘noticias’: noticias}, )
  10. 10. ... <body> {% for noticia in noticias %} <h1> {{ noticia.titulo }} </h1> <p> {{ noticia.conteudo }} </p> {% endfor %} </body> ...
  11. 11. urlpatterns = patterns('', (r'^noticias/(?P<cat>s+)/(? P<qual>s+)$', 'noticia.views.ver_noticia'), (r'^editar/(?P<id>d+)$', 'site.views.editar'), )
  12. 12. Befter.net
  13. 13. Vericia.com.br
  14. 14. Jaiku.com

×