warum istdjangosocool
DESCRIPTION
Eine sehr kurze Vorstellung des Webframeworks DjangoTRANSCRIPT
![Page 1: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/1.jpg)
DJANGOThe webframework for perfectionists with deadlines
![Page 2: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/2.jpg)
Wie liefen die Übungen bei euch?War doch ganz easy oder ?
![Page 3: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/3.jpg)
Wie liefen die Übungen bei euch?Eher doch nicht?
![Page 4: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/4.jpg)
Wir bauen uns ein Content Management System…
![Page 5: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/5.jpg)
Was braucht man dafür alles?
Seitenverwaltung
RSS-FeedsBenutzerverwaltung
Adminpanel
DatenbankWeblog
Dat
enba
nkab
frag
en
![Page 6: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/6.jpg)
Wie lange braucht man dafür wohl?
![Page 7: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/7.jpg)
Mit Django brauchst du dafür…
einzigenTag
Einen
![Page 8: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/8.jpg)
Mit Django brauchst du dafür…
WTF ?!
![Page 9: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/9.jpg)
Wo ist Django entstanden?
World OnlineEnge Deadlines
Ständig neue Anforderungen
Oft nur wenige Stunden
![Page 10: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/10.jpg)
Wer verwendet Django?
App Engine
![Page 11: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/11.jpg)
Wer verwendet Django?
![Page 12: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/12.jpg)
Wer verwendet Django?
![Page 13: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/13.jpg)
Wer verwendet Django?
NEBULA
![Page 14: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/14.jpg)
Wer verwendet Django?
![Page 15: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/15.jpg)
Was also macht Django besonders?
![Page 16: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/16.jpg)
Django ist in Python geschrieben
![Page 17: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/17.jpg)
Python ist elegant
Simple is better than complex.
Readability counts.
There should be one-- and preferably only one --obvious way to do it.
![Page 18: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/18.jpg)
Python ermöglicht sehr schnelle Entwicklung
"Python is fast enough for our site and allows us to produce maintainable features in record times, with a minimum of developers," said Cuong Do, Software Architect,YouTube.com.
![Page 19: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/19.jpg)
Python wird von der Elite benutzt
![Page 20: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/20.jpg)
Django folgt der MVC-Architektur… oder so ähnlich
View
Template
Model
Database
![Page 21: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/21.jpg)
Django folgt der MTV-Architektur!
![Page 22: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/22.jpg)
Django macht alle Datenbankarbeit für dich
Object Relational
Mapper (ORM)
Database
Object1
Foo{}
Object2
Foo{}
Kein SQL nötig!
Python-only development
Höhere Produktivität
![Page 23: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/23.jpg)
Django erzeugt deinen Adminbereich automatisch
Ein komplettes Admininterfacein nur 2 Minuten!
![Page 24: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/24.jpg)
Django-App: Simple Poll
1. Projekt anlegen
>> django-admin.py startproject mysite
2. App anlegen
>> python manage.py startapp simplepolls
![Page 25: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/25.jpg)
Simple Poll: Datenmodell erstellen
Tatort: models.py
from django.db import models
class 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()
![Page 26: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/26.jpg)
Simple Poll: Datenbank erzeugen
>> python manage.py syncdb
![Page 27: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/27.jpg)
Simple Polls: Template erstellen
Tatort: polls/index.html{% if latest_poll_list %} <ul> {% for poll in latest_poll_list %} <li> <a href="/polls/{{ poll.id }}/">{{ poll.question }}</a> </li> {% endfor %} </ul> {% else %} <p>No polls are available.</p> {% endif %}
![Page 28: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/28.jpg)
Simple Polls: View erstellen
Tatort: polls/views.py
from django.shortcuts import render_to_responsefrom polls.models import Poll
def index(request): latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5] return render_to_response('polls/index.html', {'latest_poll_list': latest_poll_list})
![Page 29: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/29.jpg)
Simple Polls: Adminbereich erstellen
settings.pyINSTALLED_APPS = ( […] 'django.contrib.admin', […])
urls.pyDrei Zeilen einkommentieren…python manage.py syncdb
Done!
![Page 30: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/30.jpg)
Was gibt es noch?
pretty url configinternationlization
caching
authentication
commentsGeoDjango
session management
syndication feeds
file handling/storage
forms logging
Und noch viel mehr…
![Page 31: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/31.jpg)
Fragen!
![Page 32: Warum istdjangosocool](https://reader035.vdocuments.pub/reader035/viewer/2022062702/554a379db4c90582328b482c/html5/thumbnails/32.jpg)
Django-Links
djangoproject.com
djangobook.com
djangopackages.com
pydev.org