Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PyConZA 2013: "Idea to launch in days. Executed Python-style." by Mike Jones

Pycon ZA
October 03, 2013

PyConZA 2013: "Idea to launch in days. Executed Python-style." by Mike Jones

There's lots of ways to get an idea built these days with new frameworks and "best practices" every time you refresh HackerNews. This talk will detail how the Western Cape Labs team built a new service from scratch in days powered by the Flask framework paired with selected items in rest of their familiar tool kit like Bootstrap and Vumi Go to make something useful and beautifully simple.

The talk will also touch on the business challenges of building products and services in South Africa that people actually use (and pay for), not just admire.

Pycon ZA

October 03, 2013
Tweet

More Decks by Pycon ZA

Other Decks in Programming

Transcript

  1. Western Cape Labs ~ [ ] Smart apps for dumb

    phones Smart sites for busy people
  2. Configure locally $ git flow init Create a issue on

    github (e.g. Start blog application) linked to user story. Start the feature $ git flow feature start issue-1-start-blog-application Code like your life depends on it $ git flow feature publish issue-1-start-blog-application Convert to a pull request $ git pull-request -i 1 -b develop Send someone the pull-request link or @mention them Once its got a +1 from the reviewer(s) and tests are passing $ git flow feature finish issue-1-start-blog-application $ git push use git flow
  3. we chose Flask and Bootstrap USE FRAMEWORKS PICK A DATASTORE

    we chose Riak, Spreedly and Xero MAKE DEPLOYMENT EASY we chose Fabric and chef-solo REUSE CODE we built on top of On The Way
  4. we chose Flask and Bootstrap USE FRAMEWORKS PICK A DATASTORE

    we chose Riak, Spreedly and Xero MAKE DEPLOYMENT EASY we chose Fabric and chef-solo REUSE CODE we built on top of OnTheWay your choices may differ!
  5. 1 file apps are nice but make a skeleton FLASK

    TIPS: #1 static <-- for css, js, img etc. (serve via nginx) templates <-- for jinja templates __init__.py <-- makes module (easy to serve) app.py <-- declare the Flask app in here config.py <-- use config objects for dev and prod main.py <-- include everything via this (no circular deps) shareddefs.py <-- place we put login_req decorators etc. sharedforms.py <-- central place for WTForms <route_name>.py <-- one per application function
  6. Less + Bootstrap + Google Fonts = Pretty compiles variables,

    plus your less file into a single css lessc source.less output.css ask someone with taste to pick one! google.com/fonts update font, set colour palette tweak variables.less
  7. creates folders, rsync’s chef recipes, run chef, creates virtualenv, pip

    installs fab <env> bootstrap rsync’s code, restarts services fab <env> deploy