SlideShare a Scribd company logo
1 of 18
Download to read offline
Django & Buildout
                                           Horst Gutmann
                                        zerok@zerokspot.com




http://creativecommons.org/licenses/by-nc-sa/3.0/at/   Photo: http://flickr.com/photos/yakobusan/2363688612/
Django
• Web Framework in Python
• MVC
• ... has tons of great features that are
  actually not really relevant for the topic at
  hand
• Summary: <3
                       2
Django and its libs
• What do we usually need ...
 • Django
 • django-tagging
 • django-threadedcomments
 • (if things like DB-bindings are already
    installed)

                      3
All of that you have to
      install on ...
•   ... your own machine
•   ... your server

•   ... and basically every other machine that has
    anything to do with the development




                        4
Installing from & with ...

•   Straight from an SCM-checkout

    •   Sadly that’s still very common since the apps
        are still quite young

•   Using a setup.py

•   Using setuptools and easy_install (PyPI <3)



                           5
Being root helps

• You have to either install these libraries as
  root user
• ... or you have to start messing around with
  the PYTHONPATH
  • ... which normally results in just a big
    mess


                       6
virtualenv

      • virtualenv lets you                       $ virtualenv myenv
          install Python packages
          without being root                      $ source myenv/bin/activate


      • It lets you build
                                                  $ cd /some/lib

                                                  $ python setup.py install
          environments for those
                                                  ....
          packages that you load
          at will                                 $ deactivate




Photo: http://flickr.com/photos/fensterbme/145621388/
                                           7
virtualenv
•   ... is a great tool if you want to try a new
    library

•   But it doesn’t solve the problem that you have
    to manually reconstruct the environment
    every time.

•   The environments are not portable (C-
    extensions?)

•   ... and not moveable (experimental right now)

                          8
zc.buildout
         •   Buildout now lets you build a whole
             environment with just one config-file

         •   Basically, it’s similar to Maven in the Java-world,
             just without XML ;-)

         •   A project consists of multiple parts

         •   Each part defines, where its data is coming from
             and where to store it


Photo: http://flickr.com/photos/mdpettitt/2521514631/
                                           9
Recipes exist ...
• ... that download eggs and build a wrapped
  interpreter to test them
• ... that download a source-distribution and
  install it
• ... that checkout code from Subversion
• ... and much much more
                      10
A small example
                                   $ buildout
>>> buildout.cfg                       PyPI           Canonical




[buildout]
parts = sample

[sample]
recipe = zc.recipe.eggs
interpreter = myinterpreter
eggs =
    storm==0.12
                                   $./bin/myinterpreter
                                   > from storm.locals import *



                              11
Buildout for Django

•   What is in for Django developers?

    •   A simple way to install dependencies

    •   ... and to freeze them at a version

    •   ... and naturally really fast deployment (even
        with a WSGI-script)



                           12
djangorecipe
• Recipe for Django projects by Jeroen
  Vloothuis:
  http://pypi.python.org/pypi/djangorecipe/
• Creates a Django project with a   given
  version
• ... and creates a wrapper for manage.py
  with all eggs and other dependencies
  loaded

                     13
Another example
[buildout]
parts = django svnapps

[django]
recipe = djangorecipe
version = 1.0
project = mysite
settings = settings
extra-paths =
    ${svnapps:location}/tagging

[svnapps]
recipe = iw.recipe.subversion
urls =
    http://django-tagging.googlecode.com/svn/trunk/ tagging



                            14
./bin/django
import sys
sys.path[0:0] = [
  '$HOME/.buildout/eggs/djangorecipe-0.12.1-py2.6.egg',
  '$HOME/.buildout/eggs/zc.recipe.egg-1.1.0-py2.6.egg',
  '$HOME/.buildout/eggs/zc.buildout-1.1.1-py2.6.egg',
  '$HOME/.buildout/eggs/setuptools-0.6c9-py2.6.egg',
  '$HOME/tmp/buildout2/parts/django',
  '$HOME/tmp/buildout2',
  '$HOME/tmp/buildout2/parts/svnapps/tagging',
  ]

import djangorecipe.manage
if __name__ == '__main__':
   djangorecipe.manage.main('mysite.settings')



                           15
mod_wsgi?

• djangorecipe can also be used to create a
  WSGI-script
  • Option: wsgi = true
  • ./bin/django.wsgi
• Naturally also includes all the dependencies

                     16
Summary
•   Buildout provides easy dependency management
    from a multitude of sources (public or not and not
    only with setuptools)

•   Dependencies AND freezing of them

•   For developing on a Django project all you need is
    one buildout.cfg

•   djangorecipe also provides you with a WSGI-script

•   Migrating to it is very easy :-)

                            17
Some links

• http://www.djangoproject.com
• http://pypi.python.org/pypi/zc.buildout/
• http://pypi.python.org/pypi/djangorecipe/
• Icons: http://graffletopia.com/stencils/144
• Pony: http://djangopony.com
                      18

More Related Content

What's hot

An intro to the JAMStack and Eleventy
An intro to the JAMStack and EleventyAn intro to the JAMStack and Eleventy
An intro to the JAMStack and EleventyLuciano Mammino
 
Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018Marco Chiesi
 
Node js实践
Node js实践Node js实践
Node js实践jay li
 
Adventures in infrastructure as code
Adventures in infrastructure as codeAdventures in infrastructure as code
Adventures in infrastructure as codeJulian Simpson
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceJon Peck
 
Plone and docker
Plone and dockerPlone and docker
Plone and dockerAlin Voinea
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)Soshi Nemoto
 
Webinar - Setup MySQL with Puppet
Webinar - Setup MySQL with PuppetWebinar - Setup MySQL with Puppet
Webinar - Setup MySQL with PuppetOlinData
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK SeminarMartin Scharm
 
Sage 2 19_v5_busby
Sage 2 19_v5_busbySage 2 19_v5_busby
Sage 2 19_v5_busbyBen Busby
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptLars Thorup
 
Docker in Production: Reality, Not Hype
Docker in Production: Reality, Not HypeDocker in Production: Reality, Not Hype
Docker in Production: Reality, Not Hypebridgetkromhout
 
Native Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developersNative Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developersJorge Arteiro
 
Magento 2 Capistrano Deploy
Magento 2 Capistrano DeployMagento 2 Capistrano Deploy
Magento 2 Capistrano DeployDuke Dao
 

What's hot (20)

An intro to the JAMStack and Eleventy
An intro to the JAMStack and EleventyAn intro to the JAMStack and Eleventy
An intro to the JAMStack and Eleventy
 
Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018
 
Grooscript gr8conf 2015
Grooscript gr8conf 2015Grooscript gr8conf 2015
Grooscript gr8conf 2015
 
Grooscript greach
Grooscript greachGrooscript greach
Grooscript greach
 
Node js实践
Node js实践Node js实践
Node js实践
 
Adventures in infrastructure as code
Adventures in infrastructure as codeAdventures in infrastructure as code
Adventures in infrastructure as code
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interface
 
Plone and docker
Plone and dockerPlone and docker
Plone and docker
 
Grooscript and Grails 3
Grooscript and Grails 3Grooscript and Grails 3
Grooscript and Grails 3
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)
 
Webinar - Setup MySQL with Puppet
Webinar - Setup MySQL with PuppetWebinar - Setup MySQL with Puppet
Webinar - Setup MySQL with Puppet
 
Front-end tools
Front-end toolsFront-end tools
Front-end tools
 
Grunt All Day
Grunt All DayGrunt All Day
Grunt All Day
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK Seminar
 
Sage 2 19_v5_busby
Sage 2 19_v5_busbySage 2 19_v5_busby
Sage 2 19_v5_busby
 
Continuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScriptContinuous Integration for front-end JavaScript
Continuous Integration for front-end JavaScript
 
Docker in Production: Reality, Not Hype
Docker in Production: Reality, Not HypeDocker in Production: Reality, Not Hype
Docker in Production: Reality, Not Hype
 
Native Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developersNative Containers on Windows 10 using Docker – a game changer for developers
Native Containers on Windows 10 using Docker – a game changer for developers
 
Zenoss: Buildout
Zenoss: BuildoutZenoss: Buildout
Zenoss: Buildout
 
Magento 2 Capistrano Deploy
Magento 2 Capistrano DeployMagento 2 Capistrano Deploy
Magento 2 Capistrano Deploy
 

Similar to Django & Buildout (en)

Getting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platformGetting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platformJean-Michel Bouffard
 
Jython on Django
Jython on DjangoJython on Django
Jython on Djangofwierzbicki
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modulesKris Buytaert
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalChad Woolley
 
Marek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with BuildoutMarek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with Buildoutmarekkuziel
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-stepMichelangelo van Dam
 
Django Deployment with Fabric
Django Deployment with FabricDjango Deployment with Fabric
Django Deployment with FabricJonas Nockert
 
Virtualenv
VirtualenvVirtualenv
VirtualenvWEBdeBS
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with DjangoRoger Barnes
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructureSergiy Kukunin
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & moreJacqueline Kazil
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
Ultimate Survival - React-Native edition
Ultimate Survival - React-Native editionUltimate Survival - React-Native edition
Ultimate Survival - React-Native editionRichard Radics
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016Hendrik Ebbers
 
Vagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyGeronimo Orozco
 
“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.Graham Dumpleton
 
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたfurusin
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentCarlos Perez
 

Similar to Django & Buildout (en) (20)

Getting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platformGetting started with open mobile development on the Openmoko platform
Getting started with open mobile development on the Openmoko platform
 
Jython on Django
Jython on DjangoJython on Django
Jython on Django
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
 
Marek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with BuildoutMarek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with Buildout
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-step
 
Django Deployment with Fabric
Django Deployment with FabricDjango Deployment with Fabric
Django Deployment with Fabric
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with Django
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
 
Django district pip, virtualenv, virtualenv wrapper & more
Django district  pip, virtualenv, virtualenv wrapper & moreDjango district  pip, virtualenv, virtualenv wrapper & more
Django district pip, virtualenv, virtualenv wrapper & more
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Ultimate Survival - React-Native edition
Ultimate Survival - React-Native editionUltimate Survival - React-Native edition
Ultimate Survival - React-Native edition
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016
 
Vagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easy
 
“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.
 
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみたネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
ネイティブAndroidエンジニアがVueNativeでiOSアプリを作ってみた
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
 

Recently uploaded

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Recently uploaded (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Django & Buildout (en)

  • 1. Django & Buildout Horst Gutmann zerok@zerokspot.com http://creativecommons.org/licenses/by-nc-sa/3.0/at/ Photo: http://flickr.com/photos/yakobusan/2363688612/
  • 2. Django • Web Framework in Python • MVC • ... has tons of great features that are actually not really relevant for the topic at hand • Summary: <3 2
  • 3. Django and its libs • What do we usually need ... • Django • django-tagging • django-threadedcomments • (if things like DB-bindings are already installed) 3
  • 4. All of that you have to install on ... • ... your own machine • ... your server • ... and basically every other machine that has anything to do with the development 4
  • 5. Installing from & with ... • Straight from an SCM-checkout • Sadly that’s still very common since the apps are still quite young • Using a setup.py • Using setuptools and easy_install (PyPI <3) 5
  • 6. Being root helps • You have to either install these libraries as root user • ... or you have to start messing around with the PYTHONPATH • ... which normally results in just a big mess 6
  • 7. virtualenv • virtualenv lets you $ virtualenv myenv install Python packages without being root $ source myenv/bin/activate • It lets you build $ cd /some/lib $ python setup.py install environments for those .... packages that you load at will $ deactivate Photo: http://flickr.com/photos/fensterbme/145621388/ 7
  • 8. virtualenv • ... is a great tool if you want to try a new library • But it doesn’t solve the problem that you have to manually reconstruct the environment every time. • The environments are not portable (C- extensions?) • ... and not moveable (experimental right now) 8
  • 9. zc.buildout • Buildout now lets you build a whole environment with just one config-file • Basically, it’s similar to Maven in the Java-world, just without XML ;-) • A project consists of multiple parts • Each part defines, where its data is coming from and where to store it Photo: http://flickr.com/photos/mdpettitt/2521514631/ 9
  • 10. Recipes exist ... • ... that download eggs and build a wrapped interpreter to test them • ... that download a source-distribution and install it • ... that checkout code from Subversion • ... and much much more 10
  • 11. A small example $ buildout >>> buildout.cfg PyPI Canonical [buildout] parts = sample [sample] recipe = zc.recipe.eggs interpreter = myinterpreter eggs = storm==0.12 $./bin/myinterpreter > from storm.locals import * 11
  • 12. Buildout for Django • What is in for Django developers? • A simple way to install dependencies • ... and to freeze them at a version • ... and naturally really fast deployment (even with a WSGI-script) 12
  • 13. djangorecipe • Recipe for Django projects by Jeroen Vloothuis: http://pypi.python.org/pypi/djangorecipe/ • Creates a Django project with a given version • ... and creates a wrapper for manage.py with all eggs and other dependencies loaded 13
  • 14. Another example [buildout] parts = django svnapps [django] recipe = djangorecipe version = 1.0 project = mysite settings = settings extra-paths = ${svnapps:location}/tagging [svnapps] recipe = iw.recipe.subversion urls = http://django-tagging.googlecode.com/svn/trunk/ tagging 14
  • 15. ./bin/django import sys sys.path[0:0] = [ '$HOME/.buildout/eggs/djangorecipe-0.12.1-py2.6.egg', '$HOME/.buildout/eggs/zc.recipe.egg-1.1.0-py2.6.egg', '$HOME/.buildout/eggs/zc.buildout-1.1.1-py2.6.egg', '$HOME/.buildout/eggs/setuptools-0.6c9-py2.6.egg', '$HOME/tmp/buildout2/parts/django', '$HOME/tmp/buildout2', '$HOME/tmp/buildout2/parts/svnapps/tagging', ] import djangorecipe.manage if __name__ == '__main__': djangorecipe.manage.main('mysite.settings') 15
  • 16. mod_wsgi? • djangorecipe can also be used to create a WSGI-script • Option: wsgi = true • ./bin/django.wsgi • Naturally also includes all the dependencies 16
  • 17. Summary • Buildout provides easy dependency management from a multitude of sources (public or not and not only with setuptools) • Dependencies AND freezing of them • For developing on a Django project all you need is one buildout.cfg • djangorecipe also provides you with a WSGI-script • Migrating to it is very easy :-) 17
  • 18. Some links • http://www.djangoproject.com • http://pypi.python.org/pypi/zc.buildout/ • http://pypi.python.org/pypi/djangorecipe/ • Icons: http://graffletopia.com/stencils/144 • Pony: http://djangopony.com 18