Django on Jython <ul><li>Leo Soto </li></ul>
<ul><li>Not exactly “ Summer  of Code”  but... </li></ul><ul><li>...worked incredibly well! </li></ul><ul><li>And that's w...
Why Django  on Jython ? <ul><li>Integration </li></ul><ul><li>Deployment </li></ul><ul><li>Performance </li></ul>
Jython
Jython <ul><li>Implementation of Python </li></ul><ul><li>Compiles to Java bytecode </li></ul><ul><ul><li>No  foo.pyc </li...
Jython <ul><li>Makes Java look like Python </li></ul><ul><li>And Python like Java to Java programs </li></ul><ul><li>No GI...
>>> from __future__ import GIL Traceback (most recent call last): ... SyntaxError: Never going to happen! (<stdin>, line 1)
State of Jython 2.5 <ul><li>99.4% of ~5700 test cases passing  </li></ul><ul><li>~20% faster on PyStone [FWIW]  </li></ul>...
Java - What We Like <ul><li>Great systems programming language </li></ul><ul><li>Well-defined memory, concurrency model </...
Java Ecosystem <ul><li>Excel, thru Apache POI support of OLE </li></ul><ul><li>Full text search with Lucene </li></ul><ul>...
Biggest Benefit <ul><li>Just use what is good out there in the Java ecosystem </li></ul>
Now...
Why in the name of... <ul><li>J2EE was a big, horrible mistake </li></ul><ul><li>But lessons have been learned </li></ul><...
“We write Java so you don’t  have  to.”
Combination <ul><li>In Python code: </li></ul><ul><ul><li>Django app framework </li></ul></ul><ul><ul><ul><li>Models, temp...
Deployment Options <ul><li>Java App Servers! </li></ul>
modjy <ul><li>Servlets <=> WSGI </li></ul>
WAR! <ul><li>Web ARchive format </li></ul><ul><ul><li>Standard deployment of Java webapps </li></ul></ul><ul><ul><li>Just ...
A Django WAR: <ul><li>jython manage.py war --include-java-libs=XXX.jar </li></ul>
WAR format for DoJ <ul><li>|-- WEB-INF </li></ul><ul><li>|  |-- lib  ← JDBC driver </li></ul><ul><li>|  `-- lib-python  </...
What’s missing <ul><li>PIL! so no Photolog </li></ul><ul><li>Oracle, MySQL, SQLServer backends </li></ul><ul><ul><li>But t...
Django Backend Dev <ul><li>Features </li></ul><ul><li>Operations </li></ul><ul><li>Client </li></ul><ul><li>Creation and I...
 
Demo
Thanks!
Upcoming SlideShare
Loading in...5
×

Django On Jython (for Portland and Boulder Python user groups presentations)

1,791

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,791
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
32
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Django On Jython (for Portland and Boulder Python user groups presentations)

  1. 1. Django on Jython <ul><li>Leo Soto </li></ul>
  2. 2. <ul><li>Not exactly “ Summer of Code” but... </li></ul><ul><li>...worked incredibly well! </li></ul><ul><li>And that's why I'm here :) </li></ul>
  3. 3. Why Django on Jython ? <ul><li>Integration </li></ul><ul><li>Deployment </li></ul><ul><li>Performance </li></ul>
  4. 4. Jython
  5. 5. Jython <ul><li>Implementation of Python </li></ul><ul><li>Compiles to Java bytecode </li></ul><ul><ul><li>No foo.pyc </li></ul></ul><ul><ul><li>It's foo$py.class </li></ul></ul>
  6. 6. Jython <ul><li>Makes Java look like Python </li></ul><ul><li>And Python like Java to Java programs </li></ul><ul><li>No GIL, no ref counting </li></ul>
  7. 7. >>> from __future__ import GIL Traceback (most recent call last): ... SyntaxError: Never going to happen! (<stdin>, line 1)
  8. 8. State of Jython 2.5 <ul><li>99.4% of ~5700 test cases passing </li></ul><ul><li>~20% faster on PyStone [FWIW] </li></ul><ul><li>2.5 alpha 2 last weekend for DjangoCon </li></ul><ul><li>September/October beta </li></ul><ul><li>December/January final </li></ul>
  9. 9. Java - What We Like <ul><li>Great systems programming language </li></ul><ul><li>Well-defined memory, concurrency model </li></ul><ul><li>Standard libraries - concurrent collections </li></ul>
  10. 10. Java Ecosystem <ul><li>Excel, thru Apache POI support of OLE </li></ul><ul><li>Full text search with Lucene </li></ul><ul><li>Scalability with Hadoop, Hbase </li></ul><ul><li>Scala, JRuby, Rhino... </li></ul>
  11. 11. Biggest Benefit <ul><li>Just use what is good out there in the Java ecosystem </li></ul>
  12. 12. Now...
  13. 13. Why in the name of... <ul><li>J2EE was a big, horrible mistake </li></ul><ul><li>But lessons have been learned </li></ul><ul><ul><li>And it’s possible to use that infrastructure </li></ul></ul>
  14. 14. “We write Java so you don’t have to.”
  15. 15. Combination <ul><li>In Python code: </li></ul><ul><ul><li>Django app framework </li></ul></ul><ul><ul><ul><li>Models, templates, forms </li></ul></ul></ul><ul><ul><li>Business logic - as complex as necessary </li></ul></ul><ul><li>In Java code (optional) </li></ul><ul><ul><li>Performant infrastructure </li></ul></ul>
  16. 16. Deployment Options <ul><li>Java App Servers! </li></ul>
  17. 17. modjy <ul><li>Servlets <=> WSGI </li></ul>
  18. 18. WAR! <ul><li>Web ARchive format </li></ul><ul><ul><li>Standard deployment of Java webapps </li></ul></ul><ul><ul><li>Just a zip file with a standard directory layout </li></ul></ul>
  19. 19. A Django WAR: <ul><li>jython manage.py war --include-java-libs=XXX.jar </li></ul>
  20. 20. WAR format for DoJ <ul><li>|-- WEB-INF </li></ul><ul><li>| |-- lib ← JDBC driver </li></ul><ul><li>| `-- lib-python </li></ul><ul><li>| |-- Lib ← Python Std. library </li></ul><ul><li>| |-- django </li></ul><ul><li>| |-- doj </li></ul><ul><li>| |-- modjy-django </li></ul><ul><li>| `-- mysite ← Your code! </li></ul><ul><li>`-- media ← (and media files) </li></ul>
  21. 21. What’s missing <ul><li>PIL! so no Photolog </li></ul><ul><li>Oracle, MySQL, SQLServer backends </li></ul><ul><ul><li>But that’s easy </li></ul></ul><ul><ul><li>zxJDBC: JDBC <=> DB-API </li></ul></ul>
  22. 22. Django Backend Dev <ul><li>Features </li></ul><ul><li>Operations </li></ul><ul><li>Client </li></ul><ul><li>Creation and Introspection </li></ul><ul><li>Validation </li></ul><ul><li>Wrapper </li></ul>
  23. 24. Demo
  24. 25. Thanks!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×