AWS Community Day CPH - Three problems of Terraform
Build and Deploy a Python Web App to Amazon in 30 Mins
1. Build and Deploy a Web
Application in 30 Minutes
August 23rd, 2012 @kLab
Kigali, Rwanda
Jeff Hull
@jsh2134
github.com/jsh2134
2. In 30 Minutes we will
● Create an App
● Deploy a Server
● Launch the App
Pro Tip: You can fork the finished code here
http://github.com/jsh2134/thirty-min-app
3. Who Are You?
● Buzzient Social CRM and Analytics
– Dev Manager and Lead Engineer
– 100K Lines of Code, 15 Servers, 24/7 Ops
– Recruited and Managed team of 4+ Engineers
● My Ivy Leaguer Test Prep and Tutoring Service
– Co-Founder and Lead Developer
– Built Tutor/Client CRM software
● Compete.com Web Analytics
– Software Developer Intern
– Built Ad Scraper that powered their Ad Impact product
4. No Really, Who Are You?
● I like to Build things (on the Internet)
● The Internet is perfect
– For Creation
– For Distribution
– For Disruption
– For Monetization
– For Success
– For Failure
– For LOLcats
●
5. “Startups are like jumping
out of a plane and figuring
out how to build the
parachute as you fall.”
-- Someone Smart
6. Learn by Experience
Write Code
● So you can learn how good/bad it is
Share Code
● So someone can tell you how good/bad it is
Deploy Code
● So the user can show you how good/bad it is
7. Best Advice: Just Dive In
● Social Coding
– GitHub
– StackOverflow
● Courses
– Udacity.com
– CodeAcademy.com
● Hacker News
– http://news.ycombinator.com
– Code Tutorials, Startup News, Rants and Raves
8. The App
● Pure Python
● A Simple Flask App
● Displays Facebook Images matching a word
● Use Twitter Bootstrap for Style
● Use Git for Version Control
● Deploy to Amazon
Lets get started...
9. Friends don't let Friends not use Git
● Git is your friend
● GitHub is your best friend
More Octocats at http://octodex.github.com
11. What is Flask?
● Lightweight Python web Framework
● Like Django but Simpler
– Uses all the best parts
● ~5000 Lines of Code
– Can easily dig in if you need to debug or change
● Leverages Jinja and Werkzeug
– Werkzeug debugger is incredible
12. The Simplest Flask App
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()
16. Boto
● Python interface to Amazon Web Services
● Create/Start/Stop Servers on Demand
– Can do everything actually
– Boto is @&$?ing awesome
● Actively Developed
● AWS very Flexible