Django nedir yenir mi?

  • 1,468 views
Uploaded on

özgür web teknolojileri 2011'de yapılan Django nedir, yenir mi? sunumu

özgür web teknolojileri 2011'de yapılan Django nedir, yenir mi? sunumu

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
1,468
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
6
Comments
1
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. nedir, yenir mi? Cihan Okyaycihan.okyay@linux.org.tr @cihann
  • 2. * Open source* Nesne Yönelimli* Temiz sözdizimi* Öğrenmesi kolay* Güçlü
  • 3. Guido van Rossum
  • 4. a = 10if a > 5: print büyükelse: print küçükdef factorial(x): if x == 0: return 1 else: return x * factorial(x - 1)factorial(5)
  • 5. Django The Web framework for perfectionists with deadlines ...
  • 6. ... not a framework forbeginners with deadlines
  • 7. Tarihi2003: Kansas, USA2005: BSD & 0.902008: 1.02011: 1.3
  • 8. Özellikler * Dökümantasyon * ORM * URL dispatcher * Templates * Interactive terminal * Admin Panel
  • 9. * Authentication & Authorization* i18n i L10n* Cache* Forms
  • 10. Mimari MTV (Model, Template, View)
  • 11. Modelfrom django.db import models classclass Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField(date published)class Choice(models.Model): poll = models.ForeignKey(Poll) choice = models.CharField(max_length=200) votes = models.IntegerField()
  • 12. ORM>>> from polls.models import Poll, Choice>>> Poll.objects.all()[]>>> import datetime>>> p = Poll(question="Naber?",... pub_date=datetime.datetime.now())>>> p.save()>>> p.id1>>> p.question"Naber?"
  • 13. orm devam>>> Poll.objects.get(id=1)<Poll: Naber?>>>> Poll.objects.filter(question="Naber?")[<Poll: Naber?>]>>> Poll.objects.all().order_by("question")[<Poll: Naber?>]>>> Poll.objects.filter(question__startswith="Nab")[<Poll: Naber?>]
  • 14. >>> p = Poll.objects.get(question="Naber?")>>> p.question = "Naber Django?">>> p.save()>>> p.question
  • 15. Admin Panel
  • 16. Viewsfrom django.http import HttpResponsedef hello(request): return HttpResponse("Hello World!")from django.shortcuts import render_to_responsefrom polls.models import *def index(request): latest_poll_list = Poll.objects.all().order_by(-pub_date) return render_to_response(index.html, {latest_poll_list: latest_poll_list})
  • 17. URLconfsfrom django.conf.urls.defaults import *urlpatterns = patterns(", (r^polls/$, polls.views.index),)example.com/polls/
  • 18. Templates
  • 19. Örnek uygulamahttps://github.com/cihann/djangoistanbulgit@github.com:cihann/djangoistanbul.git
  • 20. TEŞEKKÜRLER SORULAR?