SlideShare a Scribd company logo
Intro to Pinax
       Kickstarting Your Django Apps
               SyPy - November 2011




    Roger Barnes                 @mindsocket
roger@mindsocket.com.au     http://gplus.to/mindsocket
Who am I

   Roger Barnes   BTech ICS

   By day: Tech Lead/Applications Developer   Java :(

   By night: Up and coming Python ninja
Topics

   Intro to Django
   Intro to Pinax
   Alternatives
   Development Tips
   Q&A
What is Django

   ”The web framework for perfectionists with
                 deadlines”

Initially developed in an online news environment

        Designed for rapid development
Django Framework

   Object-relational mapper
   Automatic admin interface
   Elegant URL design
   Template system
   Caching
   More...
       i18n, syndication, generic views, schema
        generation, development server, user model,
        scheduled jobs, test harness, ...
Django is...


         … really well documented

       https://docs.djangoproject.com
Example: More Betterer

   My first Django app
       Goal 1: Learn some Python and Django
       Goal 2: Find out what photos people liked
Example: More Betterer

   Very simple models
       Item (an image)
       Challenge (a showdown between 2 items)
   Item manager
       counts challenge votes
       provides ordered list
st
Lessons from 1 Django app

   Django alone isn't a quickstart/shortcut for
       common web 2.0 functionality
                   OAuth, social, tagging, voting
       front-end
                   HTML, CSS, JS
   This is true of many web frameworks
       Either front- or back-end focussed
   Some best practices aren't obvious
       or are evolving (eg class-based views in 1.3)
What is Pinax
     System for kickstarting Django projects

  ”Pinax takes care of the things that many sites
have in common so you can focus on what makes
                your site different”

  Quickly go from idea to launch (and beyond)
What is Pinax

   Social friendly
       Comments
       Voting
       Notifications
       Profiles/Accounts/OAuth
       ...
   Startup friendly
       Private beta
       Invite codes
       Starter projects
When to use Pinax


Great for building and maintaining multiple sites
                    … quickly

 Not as much benefit for a big enterprise app
Pinax - Pros and cons

   Pros
       Has a lot to offer
       Easier to start with a pinax starter and adapt
   Cons
       Misunderstood
       No recent releases (but active branches on github)
       Django compatibility (Pinax 0.9a1 needed tweaks to
        work with Django 1.3)
   Overall: worth it
Example: Now and Then



  An application for aligning and overlaying
  historical images with modern equivalents
Example: Now and Then


    My 2nd Django app
       Goal 1: Libraryhack entry - http://libraryhack.org/
       Goal 2: Learn more Django & Python!
   Approx. 1 month development
   Started without Pinax
       got stuck on ”common functionality”
   Pinax helped get past theme and account
    management issues
Example: Now and Then
Pinax – Primary Features

   Project conventions
       Layout
       Deployment
   Requirements - pip dependencies
   Templates - quick prototyping
   Core and reusable apps
       Back- and front-end functionality
   Starter projects
       Basis for a Django site, several options
Pinax - Layout
|--   apps                 |--   fixtures
|     |-- about            |     `-- initial_data.json
|     |    |-- models.py   |--   locale
|     |    |-- urls.py     |     |-- ...
|     |    |-- views.py    |--   manage.py
|     |-- my_foo_app       |--   media
|     |    |-- ...         |     |-- css
|     |-- ...              |     |   `-- site_tabs.css
|     |    |-- ...         |     |-- ...
|--   deploy               |--   requirements
|     |-- pinax.fcgi       |     |-- base.txt
|     `-- pinax.wsgi       |     `-- project.txt
|--   dev.db               |--   settings.py
                           |--   templates
                           |     |-- about
                           |     |-- account
                           |     |-- ...
                           |--   tests
                           |     |-- ...
                           |--   urls.py
Pinax

                               For Now and Then:
   Requirements (pip)
                               PIL
       Base                   aino-convert
        what pinax needs       django-extensions
                               django-memcache-status
       Project                django-jenkins
                               selenium
        what you want to add   pyvirtualdisplay
                               MySQL-python
                               python-memcached
                               flickrapi
                               south
                               django-tagging
                               django-voting
                               PyYAML
                               nltk
                               minidetector
                               geopy
Pinax

   Apps
       account and profile management
            openid, e-mail verification, password management
       notifications and activity streams
       private betas and waiting lists
       badges
       tagging
       wikis, forums and blogs
       task tracking
       friend and follower relations
Pinax
   Starter projects
       zero
       basic
       account
       static
       private_beta
       cms_company
       intranet
       social
       cms_holidayhouse
       company
       sample_group
       code
Pinax

           Fairly well documented
        http://pinaxproject.com/docs/

              Code on github
Pinax project status

   Still in active development (see github)
   A new release pending
   Better ecosystem management
       Trying to solve the ”misunderstood” problem
       http://pinaxproject.com/ecosystem/
Pinax isn't

   A silver bullet for front-end
       BYO UX, design, HTML, CSS, JS skills
   Some solutions
       Twitter bootstrap – Pinax has a new theme
       Growing collection of other themes on offer
       HTML5 boilerplate
       Other template + less/CSS + Javascript library
Pinax – Idea to Launch


         The next big social network
         mytweetbooktubelyplus.com

   Domain name is not currently registered.
           Available for you now!
Pinax – Idea to Launch

   Steps
       mkvirtualenv --no-site-packages
        mytweetbooktubelyplus
       pip install Pinax
       pinax-admin setup_project -b social
        mytweetbooktubelyplus
       cd mytweetbooktubelyplus/
       git init
       git commit -am ”Initial commit”
Pinax – Idea to Launch

   Steps (continued)
       edit settings.py
       pip install PIL
            Better: add to requirements or remove dependent app
       python manage.py syncdb
       python manage.py runserver
    


    


       Profit!
Alternatives to Pinax

   Hand-pick your own bundled apps
       PyPI
       Djangopackages.com
   Other starter projects on github
       Eg: django-party-pack
Development tips

   South
       Schema management extension for Django
       Handles updates to existing/populated DB
                  eg: Add/change a column in dev
                  Generate/deploy code to do same in test/prod
       Integrates with django's management tools
Development tips

   Environment/package management
         virtualenv + pip (+ virtualenvwrapper)
         For more complex deploys, look at buildout
         local_settings.py (dev/test/prod)
                            Contains environment specific config
                            And passwords, add to .gitignore

        In settings.py

        try:
           from local_settings import *
        except ImportError:
           pass
Development tips - Testing

   Django + unittest2
         Fixtures for testing models (tests.json)
         Django Client to test views (request/response)

def test_point_list(self):
  """Tests that point_list returns a valid list of lists"""
  fusion = Fusion()
  fusion.points = "1,2,3,4,5,6,7,8"
  self.failUnlessEqual(fusion.point_list(), [[1,2,3,4],[5,6,7,8]])


                      def test_fusion_edit_update(self):
                        self._login()
                        response = self.client.post('/fusion/edit/1/', {'points': '', 'cropthen': ''})
                        self.assertRedirects(response, '/fusion/view/1/')
Development tips – Testing

   TODO UI tests
       Selenium or similar to test UI, esp. javascript



    def test_via_selenium(self):
      from pyvirtualdisplay import Display
      from selenium import webdriver

        display = Display(visible=0, size=(800, 600))
        display.start()

        browser = webdriver.Firefox()
        browser.get('http://myurl...')

        # TODO …
Dev tips - Continuous Integration

   Jenkins                 Build triggered by commit (or polled)
       unittest2
       django-jenkins
       coverage
Development tips - Deployment

   Fast all the way to production
       git pull - ok for simple application
                    TODO: Build pipeline
                    TODO: Continuous Deployment
   Production performance
       Apache + mod-wsgi – ok
                    Use pinax.wsgi
                    May need a little hacking to get paths right
                    TODO: try nginx + uWSGI or similar
                    TODO: High availability + reverse proxy
Development tips – Source Control

      DVCS good - Git(Hub), several alternatives
      Avoid old tech (svn, cvs, vss)
      Embrace branching, merging, regular commits
      Fork other people's repos
          Pull new changes
          Pull-request – send your improvements upstream
      Works with pip
pip install -e git+https://github.com/pinax/pinax-theme-bootstrap#egg=pinax-theme-bootstrap
Development tips
References
   Django
        https://www.djangoproject.com/
        http://djangopackages.com/
   Pinax
        http://pinaxproject.com/ & http://pinaxproject.com/ecosystem/
        https://github.com/pinax/pinax
        http://pinaxproject.com/blog/2011/10/10/djangocon-talk-pinax-after-three-years
   My apps/code
        http://bit.ly/morebetterer
        http://nowandthen.mindsocket.com.au/
        https://github.com/mindsocket/
   Twitter Bootstrap
        http://twitter.github.com/bootstrap/
Q&A

More Related Content

Viewers also liked (14)

PPTX
Keep In Touch: Channel, Expectation and Experience
Rongrong Wang
 
PDF
PROGRAMA PROMESAS CADIZ 1ªFASE
nia105
 
PDF
Schweppes Antiox business case
Alfonso Gadea
 
PDF
Matrix mtx m2_m_presentation_2013_june_v11
Jesus Santos
 
PDF
Can ufo doc_7
Clifford Stone
 
DOCX
Fundamentos Mejor En Bici
pabloesperi
 
DOCX
econozco
andercastro
 
PDF
Sociedad Civil y Colegios profesionales
Carlos Manuel Beraún Di Tolla
 
PDF
Animations à Saint-Lary du 19 mars au 3 avril 2016
Philippe Villette
 
PDF
Revista Cisco Live ed 14
Cisco do Brasil
 
PDF
A2 martín-alba-mi presentacion
Alba Martín Medina
 
PDF
EDUCACION
Chañan Coca
 
PDF
EAGES Proceedings - Hanno Fischer 2
Stephan Aubin
 
PDF
Manual diseno-puesta-a-suelo 2 resistividades
cmonti40x
 
Keep In Touch: Channel, Expectation and Experience
Rongrong Wang
 
PROGRAMA PROMESAS CADIZ 1ªFASE
nia105
 
Schweppes Antiox business case
Alfonso Gadea
 
Matrix mtx m2_m_presentation_2013_june_v11
Jesus Santos
 
Can ufo doc_7
Clifford Stone
 
Fundamentos Mejor En Bici
pabloesperi
 
econozco
andercastro
 
Sociedad Civil y Colegios profesionales
Carlos Manuel Beraún Di Tolla
 
Animations à Saint-Lary du 19 mars au 3 avril 2016
Philippe Villette
 
Revista Cisco Live ed 14
Cisco do Brasil
 
A2 martín-alba-mi presentacion
Alba Martín Medina
 
EDUCACION
Chañan Coca
 
EAGES Proceedings - Hanno Fischer 2
Stephan Aubin
 
Manual diseno-puesta-a-suelo 2 resistividades
cmonti40x
 

Similar to Intro to Pinax: Kickstarting Your Django Apps (20)

PDF
Pinax Tutorial 09/09/09
Daniel Greenfeld
 
PDF
Pinax Presentation at DjangoCon 2008
jtauber
 
PDF
GDG Addis - An Introduction to Django and App Engine
Yared Ayalew
 
KEY
Django Deployment with Fabric
Jonas Nockert
 
PDF
Web Development with Python and Django
Michael Pirnat
 
PDF
Pinax
DjangoCon2008
 
PDF
Django in Action (MEAP V01) Christopher Trudeau
dsmplwegv4530
 
KEY
Intro To Django
Udi Bauman
 
PDF
Python & Django TTT
kevinvw
 
PDF
Introduction to Pinax
Andy McKay
 
PDF
CollegeDiveIn presentation
Karambir Singh Nain
 
ODP
dJango
Bob Chao
 
PDF
Introduction to Django
Jagdeep Singh Malhi
 
DOCX
Akash rajguru project report sem v
Akash Rajguru
 
PDF
Towards Continuous Deployment with Django
Roger Barnes
 
PPTX
Django Architecture Introduction
Haiqi Chen
 
PDF
django_introduction20141030
Kevin Wu
 
PPTX
Django Framework Interview Guide - Part 1
To Sum It Up
 
PDF
Django Overview
Brian Tol
 
PPT
Pinax Introduction
Daniel Greenfeld
 
Pinax Tutorial 09/09/09
Daniel Greenfeld
 
Pinax Presentation at DjangoCon 2008
jtauber
 
GDG Addis - An Introduction to Django and App Engine
Yared Ayalew
 
Django Deployment with Fabric
Jonas Nockert
 
Web Development with Python and Django
Michael Pirnat
 
Django in Action (MEAP V01) Christopher Trudeau
dsmplwegv4530
 
Intro To Django
Udi Bauman
 
Python & Django TTT
kevinvw
 
Introduction to Pinax
Andy McKay
 
CollegeDiveIn presentation
Karambir Singh Nain
 
dJango
Bob Chao
 
Introduction to Django
Jagdeep Singh Malhi
 
Akash rajguru project report sem v
Akash Rajguru
 
Towards Continuous Deployment with Django
Roger Barnes
 
Django Architecture Introduction
Haiqi Chen
 
django_introduction20141030
Kevin Wu
 
Django Framework Interview Guide - Part 1
To Sum It Up
 
Django Overview
Brian Tol
 
Pinax Introduction
Daniel Greenfeld
 
Ad

Recently uploaded (20)

PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
Ad

Intro to Pinax: Kickstarting Your Django Apps

  • 1. Intro to Pinax Kickstarting Your Django Apps SyPy - November 2011 Roger Barnes @mindsocket [email protected] http://gplus.to/mindsocket
  • 2. Who am I  Roger Barnes BTech ICS  By day: Tech Lead/Applications Developer Java :(  By night: Up and coming Python ninja
  • 3. Topics  Intro to Django  Intro to Pinax  Alternatives  Development Tips  Q&A
  • 4. What is Django ”The web framework for perfectionists with deadlines” Initially developed in an online news environment Designed for rapid development
  • 5. Django Framework  Object-relational mapper  Automatic admin interface  Elegant URL design  Template system  Caching  More...  i18n, syndication, generic views, schema generation, development server, user model, scheduled jobs, test harness, ...
  • 6. Django is... … really well documented https://docs.djangoproject.com
  • 7. Example: More Betterer  My first Django app  Goal 1: Learn some Python and Django  Goal 2: Find out what photos people liked
  • 8. Example: More Betterer  Very simple models  Item (an image)  Challenge (a showdown between 2 items)  Item manager  counts challenge votes  provides ordered list
  • 9. st Lessons from 1 Django app  Django alone isn't a quickstart/shortcut for  common web 2.0 functionality  OAuth, social, tagging, voting  front-end  HTML, CSS, JS  This is true of many web frameworks  Either front- or back-end focussed  Some best practices aren't obvious  or are evolving (eg class-based views in 1.3)
  • 10. What is Pinax System for kickstarting Django projects ”Pinax takes care of the things that many sites have in common so you can focus on what makes your site different” Quickly go from idea to launch (and beyond)
  • 11. What is Pinax  Social friendly  Comments  Voting  Notifications  Profiles/Accounts/OAuth  ...  Startup friendly  Private beta  Invite codes  Starter projects
  • 12. When to use Pinax Great for building and maintaining multiple sites … quickly Not as much benefit for a big enterprise app
  • 13. Pinax - Pros and cons  Pros  Has a lot to offer  Easier to start with a pinax starter and adapt  Cons  Misunderstood  No recent releases (but active branches on github)  Django compatibility (Pinax 0.9a1 needed tweaks to work with Django 1.3)  Overall: worth it
  • 14. Example: Now and Then An application for aligning and overlaying historical images with modern equivalents
  • 15. Example: Now and Then  My 2nd Django app  Goal 1: Libraryhack entry - http://libraryhack.org/  Goal 2: Learn more Django & Python!  Approx. 1 month development  Started without Pinax  got stuck on ”common functionality”  Pinax helped get past theme and account management issues
  • 17. Pinax – Primary Features  Project conventions  Layout  Deployment  Requirements - pip dependencies  Templates - quick prototyping  Core and reusable apps  Back- and front-end functionality  Starter projects  Basis for a Django site, several options
  • 18. Pinax - Layout |-- apps |-- fixtures | |-- about | `-- initial_data.json | | |-- models.py |-- locale | | |-- urls.py | |-- ... | | |-- views.py |-- manage.py | |-- my_foo_app |-- media | | |-- ... | |-- css | |-- ... | | `-- site_tabs.css | | |-- ... | |-- ... |-- deploy |-- requirements | |-- pinax.fcgi | |-- base.txt | `-- pinax.wsgi | `-- project.txt |-- dev.db |-- settings.py |-- templates | |-- about | |-- account | |-- ... |-- tests | |-- ... |-- urls.py
  • 19. Pinax For Now and Then:  Requirements (pip) PIL  Base aino-convert what pinax needs django-extensions django-memcache-status  Project django-jenkins selenium what you want to add pyvirtualdisplay MySQL-python python-memcached flickrapi south django-tagging django-voting PyYAML nltk minidetector geopy
  • 20. Pinax  Apps  account and profile management  openid, e-mail verification, password management  notifications and activity streams  private betas and waiting lists  badges  tagging  wikis, forums and blogs  task tracking  friend and follower relations
  • 21. Pinax  Starter projects  zero  basic  account  static  private_beta  cms_company  intranet  social  cms_holidayhouse  company  sample_group  code
  • 22. Pinax Fairly well documented http://pinaxproject.com/docs/ Code on github
  • 23. Pinax project status  Still in active development (see github)  A new release pending  Better ecosystem management  Trying to solve the ”misunderstood” problem  http://pinaxproject.com/ecosystem/
  • 24. Pinax isn't  A silver bullet for front-end  BYO UX, design, HTML, CSS, JS skills  Some solutions  Twitter bootstrap – Pinax has a new theme  Growing collection of other themes on offer  HTML5 boilerplate  Other template + less/CSS + Javascript library
  • 25. Pinax – Idea to Launch The next big social network mytweetbooktubelyplus.com Domain name is not currently registered. Available for you now!
  • 26. Pinax – Idea to Launch  Steps  mkvirtualenv --no-site-packages mytweetbooktubelyplus  pip install Pinax  pinax-admin setup_project -b social mytweetbooktubelyplus  cd mytweetbooktubelyplus/  git init  git commit -am ”Initial commit”
  • 27. Pinax – Idea to Launch  Steps (continued)  edit settings.py  pip install PIL  Better: add to requirements or remove dependent app  python manage.py syncdb  python manage.py runserver    Profit!
  • 28. Alternatives to Pinax  Hand-pick your own bundled apps  PyPI  Djangopackages.com  Other starter projects on github  Eg: django-party-pack
  • 29. Development tips  South  Schema management extension for Django  Handles updates to existing/populated DB  eg: Add/change a column in dev  Generate/deploy code to do same in test/prod  Integrates with django's management tools
  • 30. Development tips  Environment/package management  virtualenv + pip (+ virtualenvwrapper)  For more complex deploys, look at buildout  local_settings.py (dev/test/prod)  Contains environment specific config  And passwords, add to .gitignore In settings.py try: from local_settings import * except ImportError: pass
  • 31. Development tips - Testing  Django + unittest2  Fixtures for testing models (tests.json)  Django Client to test views (request/response) def test_point_list(self): """Tests that point_list returns a valid list of lists""" fusion = Fusion() fusion.points = "1,2,3,4,5,6,7,8" self.failUnlessEqual(fusion.point_list(), [[1,2,3,4],[5,6,7,8]]) def test_fusion_edit_update(self): self._login() response = self.client.post('/fusion/edit/1/', {'points': '', 'cropthen': ''}) self.assertRedirects(response, '/fusion/view/1/')
  • 32. Development tips – Testing  TODO UI tests  Selenium or similar to test UI, esp. javascript def test_via_selenium(self): from pyvirtualdisplay import Display from selenium import webdriver display = Display(visible=0, size=(800, 600)) display.start() browser = webdriver.Firefox() browser.get('http://myurl...') # TODO …
  • 33. Dev tips - Continuous Integration  Jenkins  Build triggered by commit (or polled)  unittest2  django-jenkins  coverage
  • 34. Development tips - Deployment  Fast all the way to production  git pull - ok for simple application  TODO: Build pipeline  TODO: Continuous Deployment  Production performance  Apache + mod-wsgi – ok  Use pinax.wsgi  May need a little hacking to get paths right  TODO: try nginx + uWSGI or similar  TODO: High availability + reverse proxy
  • 35. Development tips – Source Control  DVCS good - Git(Hub), several alternatives  Avoid old tech (svn, cvs, vss)  Embrace branching, merging, regular commits  Fork other people's repos  Pull new changes  Pull-request – send your improvements upstream  Works with pip pip install -e git+https://github.com/pinax/pinax-theme-bootstrap#egg=pinax-theme-bootstrap
  • 37. References  Django  https://www.djangoproject.com/  http://djangopackages.com/  Pinax  http://pinaxproject.com/ & http://pinaxproject.com/ecosystem/  https://github.com/pinax/pinax  http://pinaxproject.com/blog/2011/10/10/djangocon-talk-pinax-after-three-years  My apps/code  http://bit.ly/morebetterer  http://nowandthen.mindsocket.com.au/  https://github.com/mindsocket/  Twitter Bootstrap  http://twitter.github.com/bootstrap/
  • 38. Q&A