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

  • 1,722 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,722
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
31
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

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