Your SlideShare is downloading. ×
0
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Django nedir
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Django nedir

401

Published on

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

  • Be the first to like this

No Downloads
Views
Total Views
401
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
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 ?
  • 2. Framework Nedir ?
  • 3. Neden Django ?• Open Source• Nesne yönelimli ( OOP )• Temiz kod• Öğrenmesi Kolay• Hızlı
  • 4. Kimler Django Kullanıyor
  • 5. Özellikleri• Dökümantasyon• Şık URL yapısı• Template Dizayn• Çoklu Dil Desteği• MTV mimarisi• Cache• Form
  • 6. Yapıproje_adi/manage.pyproje_adi/__init__.pysettings.pyurls.pywsgi.pyapp/__init__.pymodels.pytests.pyviews.py
  • 7. Bileşenler• Models - models.py• Templates - html dosyaları• Views - views.py• Url Patterns – urls.py
  • 8. Models.pyfrom django.db import modelsclass Anket(models.Model):soru = models.CharField(max_length=200)tarih = models.DateTimeField(date published)class Secim(models.Model):anket = models.ForeignKey(Anket)secilen_yazi = models.CharField(max_length=200)puan = models.IntegerField(default=0)
  • 9. ORM>>> from app.models import Anket, Secim>>> Anket.objects.all()[]>>> from django.utils import timezone>>> p = Anket(soru="Nasılsın?", tarih=timezone.now())>>> p.save()>>> p.id1>>> p.soru"Nasılsın?">>> p.tarihdatetime.datetime(2012, 2, 26, 13, 0, 0, 775217, tzinfo=<UTC>)>>> p.soru = "Nasıl Gidiyor?">>> p. save()
  • 10. Urls.pyfrom django.conf.urls import patterns, include, urlurlpatterns = patterns(,url(r^$, ‘views.index’),url(r^anketler/$, ‘views.anketler’),)# example.com/# example.com/anketler/
  • 11. Views.pyfrom django.shortcuts import renderfrom app.models import Anketdef index(request):x = Anket.objects.all().order_by(-tarih)[:5]degerler = {anketler: x}return render(request, index.html, degerler)
  • 12. Templates<html><body>{% if anketler %}<ul>{% for anket in anketler %}<li>{{ anket.soru }} </li>{% endfor %}</ul>{% else %}<p>Anket Bulunamadı.</p>{% endif %}</body></html>
  • 13. Yararlı Linkler• https://docs.djangoproject.com/• http://www.djangobook.com/• http://stackoverflow.com/• http://djangoforum.com/• http://freedjangohosting.com/

×