Conference Schedule

Track one or two? Eeenie, meenie, miney, moe…

log in to bookmark.

Deploying Django Applications With Amazon Web Services (DA CLOUD!)

A Tutorial presented by Corey Bertram

Level

Intermediate

Description

We all know that Django makes building web apps with python really easy, but few realize that Amazon Web Services makes deploying scalable fault tolerant applications just as easy! This class will focus on taking a provided Django web application and deploying it to AWS through a series of hands on exercises using many of the AWS services and some very easy to use open source Django applications.

Abstract

In this class we will start with a demo Django app that they will use for the rest of the exercises. Before getting started there will be a brief intro to Boto, a python project that makes working with AWS a joy.

Exercises:

  1. Deploy the demo Django app to a single EC2 instance using a MySQL database installed locally on an Elastic Block Storage (EBS) volume. A fabric script will be provided for most of the Django pieces, but each step will be explained.
  2. Move the applications database to Amazons Relation Database Service (RDS) and scale out reads using RDS read replicas.
  3. Add a second node for the web application and place them in an Elastic Load Balancer (ELB). Examples on how to load test these new load balancers will be given.
  4. Move the static content into S3 and then CloudFront. This will also include a brief intro to the django-storages package and Django 1.3s new static file support.
  5. Create an auto scaling group to automatically adjust the fleet of web servers based on load.

After these exercises everyone will have a working example of a deployed Django app that is setup to scale. This can be used as the groundwork for deploying standard Django applications to AWS in a scalable, fault tolerant manner. There will be a small discussion about Amazons Simple Email Service (SES) and how it can be used with django-ses as a simple drop in for sending email. We will also briefly touch on Amazons Route 53 DNS service and how it can be used to manage your domains DNS needs with open source tools.

If time permits we might be able to talk about:

  • How fabric and/or puppet/chef can be used in conjunction with AWS.
  • Different monitoring solutions and how they fit into AWS.
  • What a more complete solution looks like on AWS (dev / staging / production)

Students should bring their own laptop (if they want to follow along) and have a current AWS account including signing up for the following services: EC2, S3, CloudFront and RDS. Usage of AWS will be billed to the individual by Amazon, but it should only be a few dollars for the few hours we will use them. Setup instruction will be provided before the class so everyone can come prepared.

Although not required, some previous Django experience will give much added value to the entire tutorial as it will be immediately clear how these examples can be applied to existing apps with ease.