1. Large Problems
Mostly Solved
Eric Holscher
http://ericholscher.com
Djangocon 2010
Wednesday, September 8, 2010
2. What this talk isn’t
» In depth
» Overly technical
» Conclusive
Wednesday, September 8, 2010
3. What this talk is
» Providing current best-of-class
solutions to common problems
» Identifying problems that aren’t
currently solved well
Wednesday, September 8, 2010
4. Overview
» Patterns among good apps
» The problems that are mostly solved
» Unsolved Problems
Wednesday, September 8, 2010
39. Celery
» 19610 lines of docs
» 13822 lines of tests
» http://celeryproject.org/
» Written by Ask Solem
Wednesday, September 8, 2010
40. Setup
» pip install django-celery
» Add ‘djcelery’ to Installed Apps
» Syncdb
» Configure your settings backend
» Add @task decorator to function
Wednesday, September 8, 2010
41. When and Why
» Makes your site fast
» Use for tasks that users don’t
immediately care about
» Even if they do, return fast to a
waiting page
Wednesday, September 8, 2010
42. Examples
» Activity
» Sending Email
» Complex DB queries
Wednesday, September 8, 2010
48. Run commands on remote
servers (for deployment)
Wednesday, September 8, 2010
49. Fabric
» 7272 lines of docs
» 4572 lines of tests
» http://fabfile.org
» Written by Christian Vest Hansen &
Jeff Forcier
Wednesday, September 8, 2010
50. Setup
» pip install fabric
» Add commands to a fabfile.py
» fab <command>
Wednesday, September 8, 2010
51. Simple example
#Fabfile
from fabric.api import run
def host_type():
run('uname -s')
# Command
$ fab -H example.com host_type
Wednesday, September 8, 2010
52. Write python to deploy
your code
Wednesday, September 8, 2010
61. Pip & Virtualenv
» Written by Ian Bicking
» http://pip-installer.org
» http://virtualenv.openplans.org
Wednesday, September 8, 2010
62. Set up
» sudo easy_install pip # :D
» sudo pip install virtualenv
» virtualenv awesome_env
» source awesome_env/bin/activate
» pip install Django
Wednesday, September 8, 2010
63. Awesome Features
» Separate environments for each
application or deployment
» Install code from repos
» Doesn’t use eggs
» User-owned environment
Wednesday, September 8, 2010
78. django-[profiles|registration]
» http://bitbucket.org/ubernostrum/
django-profiles/
» http://bitbucket.org/ubernostrum/
django-registration/
» Written by James Bennett
Wednesday, September 8, 2010
95. Cal’s list of problems ’08
» Multiple Databases
» Multiple multi-keyed cache requests
» Slow HTTP requests while we're doing other stuff
» ORM creates dumb SQL
» Verbose template syntax
» No query debugger
» Ugly SQL syntax
» Commit all fields at once
» No mascot
» No deployment system
» Migrating Models
Wednesday, September 8, 2010
96. Cal’s list of problems ’08
» Multiple Databases
» Multiple multi-keyed cache requests
» Slow HTTP requests while we're doing other stuff
» ORM creates dumb SQL
» Verbose template syntax
» No query debugger
» Ugly SQL syntax (Table aliases)
» Commit all fields at once
» No mascot
» No deployment system
» Extending models
Wednesday, September 8, 2010
97. Remember
» Leverage good applications in the
community
» Take previous knowledge and apply it
to new situations
» You can create an awesome
application used by other people
Wednesday, September 8, 2010
98. Questions?
» eric@ericholscher.com
» twitter.com/ericholscher
Wednesday, September 8, 2010