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

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

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