Django on Jython Jim Baker Leo Soto
Jython Status
Shipped 2.5 (beta3)
Greatly improved “compatibility”
setuptools
virtualenv
nose
etree
 
 
web 2 py
 
 
Django + Jython:  Why?
Installing this Django app...
...in an Enterprise Infrastructure
(I mean,  this  kind of enterprise infrastructure)
Didn't work quite well
Guess  how much time it took
We like Python They  need  Java
Jython
Avoiding Java Sneaking Python Is that it?
No, it is more than that! (if you want)
Examples...
Python/Django Install Django Install 3rd party deps Install app(s) Tweak settings.py Configure web server Make sure everything is consistent Steps to Deploy a Web Application
Java Copy/upload WAR package Steps to Deploy a Web Application
Java libs can eat complex Excel data!
We can reuse what's good on the Java ecosystem!
Django + Jython:  Architecture
The cool side of Java System Programming Concurrency Model Memory Model
$ jython2.5 ... >>>  from __future__ import GIL
$ jython2.5 ... >>>  from __future__ import GIL Traceback (most recent call last):   (no code object) at line 0   File &quot;<stdin>&quot;, line 1 SyntaxError:  Never going to happen!
On the other hand...
J2EE was a big, horrible mistake
The right tool for the right job!
Java :  Performance,  Heavy lifting, Pre-existing infrastructure
Jython :  Everything else :)
Deployment
App Servers: Already there, lots of features
Let's use their force! http://flickr.com/photos/tomloudon/322172413/sizes/l/
Deployment Options Java app servers - show some horizontal scaling; also management - sys admins know how to do this! Hardened - it runs on the JVM
vs Google App Engine It’s Django  1.0 We have Unicode, internationalization, ORM, unit tests, admin, shell, everything! And we can use Java analogues: BigTable <=> HBase, Hypertable MapReduce <=> Hadoop Add pictures for app engine, HBase, Hadoop
WAR! Web ARchive format Standard deployment for Java app servers Just a bunch of files with a standard directory layout and manifest
$ jython manage.py war --include-java-libs=jdbcdriver.jar
100%  self-contained!
WAR format for DoJ |-- WEB-INF |  |-- lib |  `-- lib-python |  |-- Lib |  |-- django |  |-- doj |  `-- mysite `-- media super simple bundling!
IDE Integration
Again, why?
Quick Start!
Let People Explore
Re-factoring
One place to rule them all
Let see how that'd be with Django...
Demo
Summary
Questions?
Thanks! Jim's Blog: http://www.zyasoft.com/pythoneering/ Leo's Blog: http://blog.leosoto.com Twitter: jimbaker, leosoto
http://www.flickr.com/photos/purpleslog/231478071 http://www.flickr.com/photos/21054697@N03/2053923652 http://www.flickr.com/photos/vicintosh87/2618725412 http://www.flickr.com/photos/dipster1/1403240351 Images used under CC license
 

Django on Jython, PyCon 2009

Editor's Notes

  • #17 http://www.flickr.com/photos/purpleslog/231478071
  • #19 http://www.flickr.com/photos/21054697@N03/2053923652
  • #20 http://www.flickr.com/photos/21054697@N03/2053923652
  • #22 http://www.flickr.com/photos/vicintosh87/2618725412/
  • #28 http://www.flickr.com/photos/purpleslog/231478071
  • #31 http://www.flickr.com/photos/purpleslog/231478071
  • #36 http://www.flickr.com/photos/dipster1/1403240351