Django nedir yenir mi?
Upcoming SlideShare
Loading in...5
×
 

Django nedir yenir mi?

on

  • 1,847 views

ö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

Statistics

Views

Total Views
1,847
Views on SlideShare
1,846
Embed Views
1

Actions

Likes
1
Downloads
6
Comments
1

1 Embed 1

http://a0.twimg.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Django nedir yenir mi? Django nedir yenir mi? Presentation Transcript

  • nedir, yenir mi? Cihan Okyaycihan.okyay@linux.org.tr @cihann
  • * Open source* Nesne Yönelimli* Temiz sözdizimi* Öğrenmesi kolay* Güçlü
  • Guido van Rossum
  • 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)
  • Django The Web framework for perfectionists with deadlines ...
  • ... not a framework forbeginners with deadlines
  • Tarihi2003: Kansas, USA2005: BSD & 0.902008: 1.02011: 1.3
  • Özellikler * Dökümantasyon * ORM * URL dispatcher * Templates * Interactive terminal * Admin Panel
  • * Authentication & Authorization* i18n i L10n* Cache* Forms
  • Mimari MTV (Model, Template, View)
  • 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()
  • 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?"
  • 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?>]
  • >>> p = Poll.objects.get(question="Naber?")>>> p.question = "Naber Django?">>> p.save()>>> p.question
  • Admin Panel
  • 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})
  • URLconfsfrom django.conf.urls.defaults import *urlpatterns = patterns(", (r^polls/$, polls.views.index),)example.com/polls/
  • Templates
  • Örnek uygulamahttps://github.com/cihann/djangoistanbulgit@github.com:cihann/djangoistanbul.git
  • TEŞEKKÜRLER SORULAR?