Hosting Django: Amazon Web Services (AWS) Fundamentals
Setting up servers for your business or startup can be a tedious and expensive process, particularly when you’re just starting out or switching to a new platform. Amazon Web Services is incredible but you can still feel like you’re becoming an accidental System Administrator trying to set everything up correctly. However, with the right instructions, you can get up and running in a few hours–saving you time, money, and a headache.
This course will walk you through Amazon’s Web Services, with a focus on setting up Django and leveraging their Free Tier to keep your project free (for low-bandwidth uses for one year). We’ll start with the very basics of launching and configuring Django on EC2, discussing different ways to connect to your system while keeping it secure, we’ll progress to fine tuning your system with fast and efficient content delivery, and finally we’ll dive into all the ways that you can scale your system on this incredibly elastic platform.
A quick note: Amazon Web Services is used by some of the largest websites on the internet, including Netflix and Yelp, as it’s extremely scalable, but, it’s also a favorite of many entrepreneurs and VC’s who know to take advantage of their Free Tier. It’s just a great deal.
What this course is:
An easy-to-understand walkthrough on how to host Django using Amazon Web Services which covers: launching a Django-ready server in minutes or optionally launching a “plain” Ubuntu server and configuring Django + dependencies manually (see below for server details), setting up and enhancing security, using FTP & SSH to transfer over project files (a sample project is included) securely, serving static (CSS/JS/Image) files from a Django server and leveraging Cloud Storage (S3 and CloudFront CDN) to make your site faster, setting your project up for production, upgrading your instance for immediate performance increases, adding more instances and load balancing them, separating and vertically scaling your database, automatic scaling with cloud monitoring, deploying automatically with Beanstalk, and more. If you’re not happy after taking the course, you will absolutely get your money back.
(Server Configuration Details: Ubuntu Linux 14.04 with Apache, Mod_WSGI, MySQL & Django — but you can easily switch to Nginx/PostgreSQL, if preferred)
What this course is not:
Amazon has a very wide range (hundreds) of features. If you are looking for help on a particular AWS feature, view the curriculum below to make sure that it’s covered. We cover many features but cannot claim to cover everything.
You do not need your own Django project as this course provides a sample for you, however the focus is on hosting and configuring Django not creating projects. If creating Django projects from scratch is an interest, consider downloading my (free) course “Create Your First Django Website – Fast & Free” as supplementary to this course.
Every single question that is raised in the discussion panel is responded to, but this may not be the best resource to diagnose your server issues. Keep in mind that Amazon offers all kinds of support that is available 24×7.
I’ve enjoyed working with Django and AWS these last couple years — it’s what I use for my business — and I would now like to help more people take advantage of this great offer and incredibly scalable stack.
If you want to save yourself some time, money, and, possibly a headache, use this guide to speed up the process of understanding this powerful, scalable platform – remember, Amazon hosts everyone – from the busiest sites on the net, to startups on the Free Tier.
Click the enroll button to get started.
Overview of the course and instructor, including: target audience, curriculum overview, and goals.
Learn what distinguishes AWS from Google App Engine, Heroku, Rackspace, & Digital Ocean and why companies from Netflix to many Y-Combinator backed startups go with AWS.
Learn how to create an Amazon Web Services account. This is separate from your Amazon shopping account.
Logging in is simple, if you know where to start.
Launching Your Cloud Server: EC2 Instances
Learn about what EC2 or the Elastic Compute Cloud is, what it offers, and the pricing model.
Learn about Amazon Marketplace Machine Images and how they can make launching a Django server extraordinarily easy. We'll use a Bitnami Django AMI to launch our first preconfigured server.
Launch a normal Ubuntu 14.04 (or Microsoft Server, etc.) which is just as easy as launching a Marketplace AMI, you'll just have to configure it later with the software that you need.
Dev To Production - Step By Step
Connect to your server using both SSH from your command line and a Amazon's graphical user interface with Java-SSH.
Learn about Security Groups and how to adjust them to allow the appropriate amount of access.
FileZilla is a powerful tool that makes transferring files between your local computer and server a piece of cake. In this video, we will download and install FileZilla and then update our security settings and permissions to make configuring a breeze.
Bitnami comes preconfigured to host your files but you may want to learn more about how the Bitnami Configuration works so you can customize your instance, as needed.
Set up Django on an Ubuntu 14.04 instance. We install Apache, MySQl, and PostgreSQL. You could easily substitute this setup with Ngin-X and other software, as desired, with the same process.
Transfer your project, update your configuration files, set up your database, and launch your own project on EC2.
Learn how to serve your Django static files on the same EC2 server that's hosting your Django application. This may not be the most efficient system (see Section 6 for a more advanced method) but it's free and quick to set up.
It's always a good idea to go through Django's security checklist before switching going live with your project. In this video, we'll walk you through the process.
Switch your project to production by updating your Allowed Hosts and testing live!
Setting Up & Managing Your Domain: Amazon Route 53
Explore the concept of DNS and Premium DNS, learning why you might want to use a service like Route 53.
Learn how to register a domain name in Route 53. I will actually purchase a domain in this process.
For users not interested in using Route 53, see how to buy a Domain Name with Namecheap.
If you already purchased your domain from another registrar, learn how to transfer it to Amazon so you can access your DNS and EC2 from the same dashboard.
Point your domain name to your EC2 server using Amazon's Route 53.
Serving Your Files Faster: S3 & CloudFront
Scalable Cloud Storage and Content Delivery are two powerful services that AWS provides. Learn why using these two tools may speed up your site as well as the price.
Integrate Amazon's S3 with Django so you can utilize the efficiency of cloud storage while not changing your workflow (you can still use "collectstatic"). Part one.
For the most efficient content delivery, you'll want to push your content to edge locations all over the world. See how to use CloudFront to speed up your site.
AWS Project Security: Identity & Access Management (IAM)
Amazon provides free, easy-to-use tools to keep your project safe. Learn more about them and why you should take advantage.
Multifactor authentication is a powerful tool to help secure your project. Learn how to set it up on your account.
Most projects require more than one person. Learn how to give everyone on your team an individual login and access policy defined by their group.
Learn a simple method to help keep your secret keys a secret.
Backing up & Relaunching: AMIs & Snapshots
At some point, your server will likely have issues. Learn about how Amazon has made backing up extremely easy.
Learn about Elastic IPs which are a powerful tool that can be used to maintain one IP address even if you decide to shut down your current instance.
Create a backup or "machine image" of your server that you use to launch new instances in seconds.
Scaling on AWS: Upgrading Your Instance, Amazon RDS, & ELB
Compare and contrast two different types of scaling and how Amazon provides easy ways to do both.
See a handy tool that can be used to analyze your server performance: JMeter.
Upgrade your instance type for an immediate performance boost.
Separating our database from our web server is the first step we'll take to create a dynamic server cluster.
Create a load balanced, server cluster by adding a load balancer and as many instances you want to your project.
Scaling your database server is very similar to scaling a regular EC2 instance but not exactly the same.
AutoScaling on AWS: AutoScaling Groups, Policies & CloudWatch
Learn about an incredibly powerful tool called Autoscaling which allows you to scale in and out automatically depending on criteria that you define.
Create your first autoscaling group and launch configuration which will define your desired cluster size.
Connect CloudWatch monitoring events to your Autoscaling groups to scale dynamically based on your current traffic levels. I cannot stress how powerful of a feature this is.