• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Build and Deploy a Python Web App to Amazon in 30 Mins
 

Build and Deploy a Python Web App to Amazon in 30 Mins

on

  • 5,415 views

Presented at Klab.Rw tech and entrpreneurA few slides and associated code on how to Build and Deploy a Python Web Application in under 30 minutes.

Presented at Klab.Rw tech and entrpreneurA few slides and associated code on how to Build and Deploy a Python Web Application in under 30 minutes.




Statistics

Views

Total Views
5,415
Views on SlideShare
5,112
Embed Views
303

Actions

Likes
7
Downloads
27
Comments
0

2 Embeds 303

http://engineerwithoutacause.com 302
https://twimg0-a.akamaihd.net 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Build and Deploy a Python Web App to Amazon in 30 Mins Build and Deploy a Python Web App to Amazon in 30 Mins Presentation Transcript

    • Build and Deploy a WebApplication in 30 Minutes August 23rd, 2012 @kLab Kigali, Rwanda Jeff Hull @jsh2134 github.com/jsh2134
    • 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
    • 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
    • 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●
    • “Startups are like jumpingout of a plane and figuring out how to build the parachute as you fall.” -- Someone Smart
    • Learn by ExperienceWrite Code ● So you can learn how good/bad it isShare Code ● So someone can tell you how good/bad it isDeploy Code ● So the user can show you how good/bad it is
    • 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
    • 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...
    • Friends dont let Friends not use Git ● Git is your friend ● GitHub is your best friendMore Octocats at http://octodex.github.com
    • Lets “git” started$ curl -u jsh2134 https://api.github.com/user/repos -d{"name":"my_repo"}$ git init my_repo$ cd my_repo$ git remote add origin git@github.com:jsh2134/my_repo$ vim README$ git add README$ git commit -m first commit$ git push origin
    • 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
    • The Simplest Flask Appfrom flask import Flaskapp = Flask(__name__)@app.route(/)def hello_world(): return Hello World!if __name__ == __main__: app.run()
    • And Now Some Flask Code
    • Jinja Templates● Separate the Python from the HTML● Add Logic to your HTML● Simple Syntax● Template Inheritance● Less gray hairs
    • Pause for Some Jinja Code
    • 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
    • A Quick Boto Break
    • Fabric● Execute commands on remote server● Installation Scripts● Update Code● System Admin Tasks● We will use Fabric to deploy our app
    • Fabric Examples
    • The Final Code Base __init__.py settings.py app.py ec2.py fabfile.py requirements.txt templates/photos.htmlstatic/css/bootstrap.css
    • Deploy the Code
    • Finito● Fork this on Github – http://github.com/jsh2134/thirty-min-app● Contact – @jsh2134 – jsh2134@gmail.com – www.engineerwithoutacause.com● Slides will be posted online shortly