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:  7106
Downloads:  17
Published:  July 25, 2007
 
2
download

Share plick with friends Share
save to favorite
Report Abuse Report Abuse
 
Related Plicks
Hire Professional PHP Framework Programmers

Hire Professional PHP Framework Programmers

From: bellamartin
Views: 299 Comments: 0
Php Web Application Development have a professional team of PHP Framework Developers and they developed most common Php frameworks. Know more about PHP Frameworks at http://www.phpwebapplicationdevelopment.com/php-framework-development.html
 
Zend Framework Development

Zend Framework Development

From: annaharris
Views: 67 Comments: 0

 
Integrating Apache solr with crawels

Integrating Apache solr with crawels

From: lucid12
Views: 574 Comments: 0
This talk will describe issues involved in scalable web crawling and web search, and explain how to integrate Apache Solr as a search platform with web crawling functionality, using existing web crawling platforms: Nutch, Aperture and Lucene Connect (more)

 
Versatile PHP Framework for Dynamic Web Development

Versatile PHP Framework for Dynamic Web Development

From: SoftwebSolutions
Views: 22 Comments: 0
PHP is a robust framework that enables to build attractive and stable web applications and websites for social networking, eCommerce and other purposes. It is a highly scalable, error-free, and secure platform for web development.
 
See all 
 
More from this user
Thinking e-Business Design

Thinking e-Business Design

From: babo
Views: 5181
Comments: 0

great quotes to use and repeat when you can't find a better way of saying it

great quotes to use and repeat when you can't find a better way of saying it

From: babo
Views: 3564
Comments: 0

time management

time management

From: babo
Views: 3941
Comments: 0

MBA Essentials International Business

MBA Essentials International Business

From: babo
Views: 4998
Comments: 2

Web Common Structure

Web Common Structure

From: babo
Views: 3166
Comments: 0

social project management

social project management

From: babo
Views: 2684
Comments: 0

See all 
 
 
 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: (watch)
 
 
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