babo's picture From babo rss RSS  subscribe Subscribe

the django web application framework 



This talk
An overview of Django
What's in a web framework, anyway?
Framework comparison
and some pretty screenshots ,too
 
Tags:  web  framework 
Views:  5457
Downloads:  12
Published:  July 25, 2007
 
1
save to favorite
ask author to add audio Ask author to add audio
Share plick with friends Share
mark as inappropriate Mark as inappropriate
 
Related Plicks
Dev 6 Developing Sharepoint Portal Server WebParts

Dev 6 Developing Sharepoint Portal Server WebParts

From: gavi
Views: 1576 Comments: 0
Developing Web Parts using Visual Studio.NET
 
clase 3

clase 3

From: andres
Views: 6244 Comments: 0
¿Qué es un Framework?
¿Qué es Framework 2.0?

¿Qué problemas resuelve .NET?
.NET Framework
CLR – Common Language Runtime (more)

 
MediaHub Solution Framework

MediaHub Solution Framework

From: SweetAss
Views: 1692 Comments: 0
Introduction to mediahub solution frameword
 
Comparing .NET and Java

Comparing .NET and Java

From: emily
Views: 1279 Comments: 0
NET
The .NET Framework
Java
Java application servers
Products include:
IBM WebSphere Application Server (more)

 
S/W Development on the Web Platform

S/W Development on the Web Platform

From: gavi
Views: 1333 Comments: 0
Platform
Web Platform
The old web development
The new web development technique
The Barriers
How to overcome? (more)

 
Model driven development of SOA with Web services – using QVT technology

Model driven development of SOA with Web services – using QVT technology

From: babo
Views: 2715 Comments: 1
SOA
Service Oriented Architecture
Focus is set on Web services
MDA
Model Driven Architecture
Framework for model-driven deve (more)

 
See all 
 
More from this user
20070419earth

20070419earth

From: babo
Views: 3163
Comments: 2

 Digital Identity within E-Business and E-Government: Where are we now and Where do we go from here

Digital Identity within E-Business and E-Government: Where are we now and Where do we go from here

From: babo
Views: 2823
Comments: 1

ASAP Jan06 Presentation Merrifield

ASAP Jan06 Presentation Merrifield

From: babo
Views: 3956
Comments: 1

《 企業如何建構藍海策略 》

《 企業如何建構藍海策略 》

From: babo
Views: 6233
Comments: 1

3   Sune Schackenfeldt   PA Consulting

3 Sune Schackenfeldt PA Consulting

From: babo
Views: 3047
Comments: 2

2009 3 Blue Ocean Strategy s2  HO 2

2009 3 Blue Ocean Strategy s2 HO 2

From: babo
Views: 5344
Comments: 1

See all 
 
Place your Ad here for $2.00 a month
Sample Ad
Advertise your business on myplick.
Only $2.00 a month.
 
 URL:          AddThis Social Bookmark Button
Embed Thin Player: (fits in most blogs)
Embed Full Player :
 
 

Name

Email (will NOT be shown to other users)

 

 
 
Comments:
 
 
Notes:
 
 
Slide 1: The Django Web Application Framework Simon Willison http://simonwillison.net/ ACCU, Python Track, 20th April 2006
Slide 2: This talk An overview of Django What's in a web framework, anyway? Framework comparison (and some pretty screenshots, too)
Slide 3: Origins
Slide 4: Lawrence, Kansas - 2003
Slide 10: Web development on Journalism deadlines
Slide 15: ... in three days
Slide 16: The ideal framework... Clean URLs Loosely coupled components Designer-friendly templates As little code as possible Really fast development
Slide 17: We didn’t mean to build a framework...
Slide 18: ... but nothing else really fitted the bill
Slide 19: Building a framework
Slide 20: HTTP handling
Slide 21: GET /community/ HTTP/1.0 Host: www.djangoproject.com HTTP/1.1 200 OK Date: Wed, 19 Apr 2006 23:53:29 GMT Server: Apache Vary: Cookie Connection: close Content-Type: text/html; charset=utf-8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> [...]
Slide 22: Parse the request; generate a response
Slide 23: GET variables, POST variables, cookies, uploaded files, caching, content negotiation
Slide 24: HttpRequest HttpResponse
Slide 25: def index(request): s = “Hello, World” return HttpResponse(s)
Slide 26: def index(request): r = HttpResponse( mimetype='text/plain' ) r.write(“Hello, World”) return r
Slide 27: def index(request): if request.GET: s = “Hi, %s” % \ escape(request.GET.get( ’name’, ‘anon’) else: s = “Hello, World” return HttpResponse(s)
Slide 28: URL dispatching
Slide 29: http://www.example.com/poll/5/ What code shall we execute?
Slide 30: urlpatterns = patterns('', (r'^$', 'views.index'), (r'^hello/', ‘views.hello'), (r'^poll/(\d+)/', ‘views.poll'), )
Slide 31: Database access
Slide 32: ... (r'^poll/(\d+)/', 'views.poll'), ... def poll(request, poll_id): poll = Poll.objects.get( pk=poll_id ) return HttpResponse( 'Title: ' + poll.title )
Slide 33: class Poll(Model): question = CharField(maxlength=200) pub_date = DateTimeField('date published') class Choice(Model): poll = ForeignKey(Poll) choice = CharField(maxlength=200) votes = IntegerField()
Slide 34: BEGIN; CREATE TABLE "polls_poll" ( "id" serial NOT NULL PRIMARY KEY, "question" varchar(200) NOT NULL, "pub_date" timestamp with time zone NOT NULL ); CREATE TABLE "polls_choice" ( "id" serial NOT NULL PRIMARY KEY, "poll_id" integer NOT NULL REFERENCES "polls_polls" ("id"), "choice" varchar(200) NOT NULL, "votes" integer NOT NULL ); COMMIT;
Slide 35: p = Poll( question = "What's up?", pub_date = datetime.now() ) p.save()
Slide 36: >>> p.id 1 >>> p.question "What's up?" >>> p.pub_date datetime(2005, 7, 15, 12, 00, 53)
Slide 37: Templating
Slide 38: Gluing strings together gets old fast
Slide 39: { 'today': datetime.date.today(), 'edibles': ['pear', 'apple', 'orange'] }
Slide 40: <h1>Hello World!</h1> <p>Today is {{ today|date:”jS F, Y” }}</p> {% if edibles %} <ul> {% for fruit in edibles %} <li>{{ fruit }}</li> {% endfor %} </ul> {% endif %}
Slide 41: <h1>Hello World!</h1> <p>Today is 20th April, 2006</p> <ul> <li>pear</li> <li>apple</li> <li>orange</li> </ul>
Slide 42: def hello(request): t = get_template('hello.html') c = Context({ 'today': datetime.date.today(), 'edibles': ['pear', 'apple', 'orange'] }) return HttpResponse(t.render(c))
Slide 43: All you really need are variables, conditionals and loops
Slide 44: Essential ingredients HTTP handling URL dispatching Templating Documentation Database access (optional) ... no wonder there are so many frameworks!
Slide 45: Extras
Slide 46: Forms are boring
Slide 47: 1. Display form 2. Validate submitted data 3. If errors, redisplay with: 3.1. Contextual error messages 3.2. Correct fields pre-filled 4. ... do something useful!
Slide 48: Model validation rules + the Manipulator API do all of this for you
Slide 49: django.contrib.admin does even more
Slide 51: class Poll(Model): question = CharField(maxlength=200) pub_date = DateTimeField('date published') class Admin: list_display = ('question', 'pub_date') class Choice(Model): poll = ForeignKey(Poll) choice = CharField(maxlength=200) votes = IntegerField() class Admin: pass
Slide 52: Smarter templating
Slide 53: Common headers and footers?
Slide 54: Template inheritance
Slide 55: base.html <html> <head> <title> {% block title %}{% endblock %} </title> </head> <body> {% block main %}{% endblock %} <div id=”footer”> {% block footer %}(c) 2006{% endblock %} <div> </body> </html>
Slide 56: home.html {% extends “base.html” %} {% block title %}Homepage{% endblock %} {% block main %} Main page contents goes here. {% endblock %}
Slide 57: combined <html> <head> <title> Homepage </title> </head> <body> Main page contents goes here. <div id=”footer”> (c) 2006 <div> </body> </html>
Slide 58: Custom template tags
Slide 60: {{ page.content|textile }}
Slide 61: {{ page.content|textile }} {% comment_form for news.stories story.id with is_public yes photos_optional thumbs,200,400 ratings_optional scale:1-5|first_option|second_option %}
Slide 62: from django import template register = template.Library() def textile(value): try: import textile except ImportError: return value else: return textile.textile(value) register.filter(textile)
Slide 63: i18n and l10n
Slide 65: Bengali Czech Welsh Danish German Greek English Spanish French Galician Hebrew Icelandic Italian Japanese Dutch Norwegian Brazilian Romanian Russian Slovak Slovenian Serbian Swedish Ukrainian Simplified Chinese Traditional Chinese
Slide 66: Authentication and authorisation
Slide 67: Community
Slide 68: ?
Slide 69: It’s a matter of taste
Slide 70: HTTP handling What happens to form variables? GET vs POST How to handle /path?foo=1&foo=2 How to send back non-standard responses Different Content-Type (and other) headers 404s, 500s Session support?
Slide 71: URL dispatching Object traversal or explicit configuration? Reversible URLs? Parameter extraction Trailing slashes?
Slide 72: Database handling To ORM or not to ORM? Pluralisation? Handling joins Lookup syntax When should you fall back on raw SQL?
Slide 73: Templating Plain text or XML? Markup visible on the page or hidden in HTML attributes? Logic in the template vs logic in the view/ controller Safe (and limited) or unsafe (and more powerful) Language extension mechanism?
Slide 74: Where’s the line? Authentication and authorisation? Automated admin / forms? i18n and l10n? JavaScript and Ajax?
Slide 75: Getting involved
Slide 78: Summer of Code 2006
Slide 79: www.djangoproject.com
Slide 81: Extra slides
Slide 82: Comparisons
Slide 84: HTTP URL dispatch Database handling Templating $_GET, $_POST, $_REQUEST etc Filesystem mysql_* functions <?php ... ?>
Slide 86: HTTP URL dispatch Database handling Templating CherryPy Object path traversal SQLObject Kid (XML), common templating API
Slide 88: HTTP URL dispatch Database handling Templating ActionController? Object traversal, Routes ActiveRecord ERb, Builder, RJS

   
Time on Slide Time on Plick
Slides per Visit Slide Views Views by Location
close
Please fill out the form below. You will be asked to make your payment to Myplick (Eastar Technologies) via Paypal. Your request will be processed within 24 hours after your submission.
 
Title (max 25 characters)
Link (placed on title)
Content (max 100 characters)
You have successfully submitted your ad request. Please send your payment to ericandlei@myplick.com via PAYPAL.
Ad submission failed. Please report the problem to ericandlei@myplick.com.