$30 off During Our Annual Pro Sale. View Details »

Solid Python Application Deployments For Everyb...

Solid Python Application Deployments For Everybody EP Edition

An expanded version of my PyCon US 2013 talk held at EuroPython 2013 in Florence.

Hynek Schlawack

June 28, 2013
Tweet

More Decks by Hynek Schlawack

Other Decks in Technology

Transcript

  1. ?

  2. “It is important to find simple solutions instead of stopping

    as soon as a first solution is found.” — Donald Knuth
  3. No!

  4. “Python 2.4 is not supported. It came out 8 years

    ago. That's older than Youtube. Upgrade.” — Kenneth Reitz
  5. Sal Pafr Application is tied to server OS version. Upgrading

    servers == updating your app. Some servers upgraded?
  6. Ue vruln $ virtualenv venv; . venv/bin/activate $ pip install

    pyramid requests pytest $ py.test … $ pip freeze >requirements.txt … $ pip install -r requirements.txt
  7. 1. check out from VCS 2. create virtualenv 3. install

    dependencies 4. do whatever you want 5. package result 6. push to your repo
  8. 1. check out from VCS 2. create virtualenv 3. install

    dependencies 4. do whatever you want 5. package result 6. push to your repo
  9. prise-oriented features to to compare the two pet Open ource

    Puppet Enterprise ✔ ✔ ✔ Not easy at all. Sltos
  10. r t

  11. Eape: usat $ cat /etc/init/yourapp.conf start on static-network-up stop on

    deconfiguring-networking respawn chdir /path/to/yourapp setuid yourapp exec /path/to/gunicorn_django settings.py $ start yourapp
  12. $ cat settings.py … INSTALLED_APPS = ( … "gunicorn", )

    … $ manage.py run_gunicorn Es t St U: gncr
  13. location / { proxy_pass unix:///tmp/app.sock; } location /static/ { root

    /your/app/public/; } Es t St U: nix
  14. Sil Es: usi uwsgi --emperor production.ini … [uwsgi] paste =

    config:%p uwsgi-socket = /tmp/app.sock processes = 2 …