34. BEGIN;
CREATE TABLE quot;polls_pollquot; (
quot;idquot; serial NOT NULL PRIMARY KEY,
quot;questionquot; varchar(200) NOT NULL,
quot;pub_datequot; timestamp with time zone
NOT NULL
);
CREATE TABLE quot;polls_choicequot; (
quot;idquot; serial NOT NULL PRIMARY KEY,
quot;poll_idquot; integer NOT NULL
REFERENCES quot;polls_pollsquot; (quot;idquot;),
quot;choicequot; varchar(200) NOT NULL,
quot;votesquot; integer NOT NULL
);
COMMIT;
42. def hello(request):
t = get_template('hello.html')
c = Context({
'today': datetime.date.today(),
'edibles': ['pear', 'apple', 'orange']
})
return HttpResponse(t.render(c))
43. All you really need are
variables, conditionals
and loops
44. Essential ingredients
HTTP handling
URL dispatching
Templating
Documentation
Database access (optional)
... no wonder there are so many frameworks!
65. Bengali Japanese
Czech Dutch
Welsh Norwegian
Danish Brazilian
German Romanian
Greek Russian
English Slovak
Spanish Slovenian
French Serbian
Galician Swedish
Hebrew Ukrainian
Icelandic Simplified Chinese
Italian Traditional Chinese
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?
72. Database handling
To ORM or not to ORM?
Pluralisation?
Handling joins
Lookup syntax
When should you fall back on raw SQL?
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?
74. Where’s the line?
Authentication and authorisation?
Automated admin / forms?
i18n and l10n?
JavaScript and Ajax?