• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Workshop For pycon13
 

Workshop For pycon13

on

  • 845 views

 

Statistics

Views

Total Views
845
Views on SlideShare
678
Embed Views
167

Actions

Likes
0
Downloads
1
Comments
0

4 Embeds 167

http://blog.philipjohnjames.com 161
http://denvertechnology.blogspot.com 4
https://twitter.com 1
http://www.denvertechnology.blogspot.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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

    Workshop For pycon13 Workshop For pycon13 Presentation Transcript

    • OpenShift Workshop – Python for the impatient Sign up code: PyConWorkshop Steven Citron-Pousty @TheSteve0 (TheSteve0 IRC) PaaS Dust Spreader, Red Hat1
    • Agenda • Start with PaaS intro • Show you OpenShift • What does development look like • Do some development – from here on hands on • Signup code: PyconWorkshop2
    • Assumptions 1) You know some Mongo 2) You know or can read some Python 3) You prefer to write code and apps over managing servers or you prefer managing servers rather than dealing with annoying developer requests3
    • What is OpenShift? Red Hats free, auto-scaling Platform as a Service (PaaS) for applications in the cloud.4
    • Kind of like Amazon, right? Nope.5
    • What’s supported?6
    • What else do I get and what is the catch?• The Catch is we are in developer preview right now• OpenShift is free-as-in-beer & free-as-in-freedom• Three gears – each one is half a gig of RAM, and 1 gig of disk (always free)• Need more resources, just ask!7
    • Cook24v on Flickr8
    • Demo 1. Create an application using the command line tools with a DB (python) 2. Create a Wordpress app from the web console 3. Before I start everyone should start installing the command line tools if they haven’t already9
    • Some terminology for today 1. Application – your web code and any data store. Has to be on 1 or more gears 2. Gear – is like a server. It can have only 1 language for the web programming. 3. Cartridge – it adds a language, a data store, or other functionality 4. Git – used for version control and managing code between server and your development machine 5. Ssh – command line tool to connect to your gear10
    • GIT Distributed Version control A local repository – on your laptop A remote repository – on some other machine, usually a server Good place to start - http://sixrevisions.com/resources/git-tutorials- beginners/11
    • OK Now it’s your turn 1. Create a python application at the command line 1. Modify the source and push it back up 2. Add mongo to your application12
    • Mongo Next steps 1. We look at the National Park data together 2. We use the code from this github repo : https://github.com/openshift/openshift-mongo-flask- example 3. We import the national park data into our MongoDB database 4. Look at the code together. 5. Write a few of the functions and maybe one of your own13
    • Flask - a microframework for Python A quick way to add code to handle specific URLs – typical in REST web services – it also does A LOT more http://flask.pocoo.org/ from flask import Flask app = Flask(__name__) @app.route("/") #this is an annotation def hello(): return "Hello World!" if __name__ == "__main__": app.run()14
    • Conclusion 1. Openshift makes life great for you 2. Lot’s of Python choices 3. The tools are easy to use 4. You should be ready to write services 5. Almost anything you need on a server 6. Did I mention – Free15
    • What usually happens on local Borrowed from: http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository16
    • What you do with Remote repositories Clone – take a remote repository and bring it local Push – push your local changes back up to a remote17
    • You need to understand at least 3 commands in Git 1. Git add . (means add all news files as being tracked in the local repository) 2. Git commit –am “your message” (means commit all my changes to the local repository with this message) 3. Git push (means push from your local repository to the repository on your OpenShift gear)18
    • Github Publically hosted git repositores (can be private if you pay for it) http://www.github.com You care about it because: 1)We have quickstarts there 2)You can put your projects there for backup19