Django Deployment Workshop

Jacob Kaplan-Moss (Revolution Systems, LLC), Frank Wiles (Revolution Systems, LLC)
Python
Location: Portland 251
Please note: to attend, your registration must include Tutorials.
Average rating: ****.
(4.29, 14 ratings)

So you’ve written a Django site… now what? Writing the application is just the beginning; now you’ve got to put it into production! In this hands-on workshop we’ll walk through the creation of a full Django deployment environment running on a cluster of (virtual) machines.

This class will introduce students to a wide variety of technologies, including, Apache, Fabric, nginx, mod_wsgi, memcached, PostgreSQL, pgpool, pg_standby, and more.

By the end of the class, each student will have created an environment featuring:

  • Multiple levels of caching and load balancing.
  • Multiple web application servers.
  • Redundant replicated database servers.

We’ll create this whole stack on virtual machines, and students will be able to take home a complete copy of all the deployment configuration for future review at their leisure.

Note: the example application used in this class with be a Django site, and the class assumes at least a moderate comfort level with Django. However, the tools and techniques apply just as well to other Python web frameworks, so users of other tools will likely be able to follow along fairly easily.

Outline:

Getting started
  • Introducing our example application.
  • Overview of where we’re going.
  • Very brief intro to EC2 and S3.
  • Exercise: run our first VM.
Application server: mod_wsgi
  • What’s an application server?
  • Introducing mod_wsgi
  • Configuring Apache and mod_wsgi
  • Exercise: deploy the application under mod_wsgi.
  • Exercise: initial load test.
Database server: PostgreSQL
  • Why a separate database server?
  • Configuring PostgreSQL
  • Exercise: deploy PostgreSQL.
Introducing Fabric
  • What’s Fabric?
  • Writing fabfiles.
  • Integrating fabfiles into Django applications.
  • Exercise: deploy using Fabric
Multiple web servers
  • Why multiple web servers?
  • “Shared nothing”
  • Dealing with medi
  • Load balancers
  • Introducing nginx
  • Using nginx as a reverse proxy
  • Exercise: deploy onto multiple machines.
  • Exercise: crash a web server.
Caching servers
  • Local caching vs. dedicated caching.
  • Introducing memcached
  • Using memcached with Django.
  • Exercise: deploy with multiple cache servers.
Database connection middleware
  • Why connection middleware?
  • Introducing pgpool.
  • Configuring pg_pool and Django.
  • Exercise: deploy pg_pool
Database redundancy
  • Redundancy strategies
  • Warm standby with pg_standby
  • Exercise: configure warm standby
  • Exercise: fall over to the slave

Final exercise: load testing – how’d we do?

Photo of Jacob Kaplan-Moss

Jacob Kaplan-Moss

Revolution Systems, LLC

Jacob Kaplan-Moss is one of the lead developers and co-creator of Django. Jacob’s an experienced software developer with a focus on web application architecture. He’s a consultant with Revolution Systems, where he helps companies deploy and scale websites using Python and Django. Jacob previously worked for the Lawrence Journal-World, a locally-owned newspaper in Lawrence, Kansas, where he helped develop and eventually open source Django.

Frank Wiles

Revolution Systems, LLC

Consultant, author, developer, and admin. Focusing on performance/scaling of Open Source technologies such as Perl/Python, Apache, Django, and PostgreSQL

Comments on this page are now closed.

Comments

Picture of Joshua Timberman
Joshua Timberman
07/23/2010 3:38pm PDT

Thanks for this tutorial, it was good to see how Django deployment compares to Rails.

  • Intel
  • Microsoft
  • Google
  • Facebook
  • Rackspace Hosting
  • (mt) Media Temple, Inc.
  • ActiveState
  • CommonPlaces
  • DB Relay
  • FireHost
  • GoDaddy
  • HP
  • HTSQL by Prometheus Research
  • Impetus Technologies Inc.
  • Infobright, Inc
  • JasperSoft
  • Kaltura
  • Marvell
  • Mashery
  • NorthScale, Inc.
  • Open Invention Network
  • OpSource
  • Oracle
  • Parallels
  • PayPal
  • Percona
  • Qualcomm Innovation Center, Inc.
  • Rhomobile
  • Schooner Information Technology
  • Silicon Mechanics
  • SourceGear
  • Symbian
  • VoltDB
  • WSO2
  • Linux Pro Magazine

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at the conference, contact Sharon Cordesse at scordesse@oreilly.com

Download the OSCON Sponsor/Exhibitor Prospectus

Media Partner Opportunities

Download the Media & Promotional Partner Brochure (PDF) for information on trade opportunities with O'Reilly conferences or contact mediapartners@ oreilly.com

Press and Media

For media-related inquiries, contact Maureen Jennings at maureen@oreilly.com

OSCON Newsletter

To stay abreast of conference news and to receive email notification when registration opens, please sign up for the OSCON Newsletter (login required)

OSCON 2.0 Ideas

Have an idea for OSCON to share? oscon-idea@oreilly.com

Contact Us

View a complete list of OSCON contacts