Running Django on Jython¶
Jython is an implementation of Python that runs on the Java platform (JVM). Django runs cleanly on Jython version 2.5 or later, which means you can deploy Django on any Java platform.
This document will get you up and running with Django on top of Jython.
Django works with Jython versions 2.5b3 and higher. Download Jython at http://www.jython.org/.
Creating a servlet container¶
If you just want to experiment with Django, skip ahead to the next section; Django includes a lightweight Web server you can use for testing, so you won’t need to set up anything else until you’re ready to deploy Django in production.
If you want to use Django on a production site, use a Java servlet container, such as Apache Tomcat. Full JavaEE applications servers such as GlassFish or JBoss are also OK, if you need the extra features they include.
Installing Jython platform support libraries¶
The django-jython project contains database backends and management commands for Django/Jython development. Note that the builtin Django backends won’t work on top of Jython.
Differences with Django on Jython¶
At this point, Django on Jython should behave nearly identically to Django running on standard Python. However, are a few differences to keep in mind:
- Remember to use the jython command instead of python. The documentation uses python for consistency, but if you’re using Jython you’ll want to mentally replace python with jython every time it occurs.
- Similarly, you’ll need to use the JYTHONPATH environment variable instead of PYTHONPATH.
Having trouble? We'd like to help!
- Try the FAQ — it's got answers to many common questions.
- Search for information in the archives of the django-users mailing list, or post a question.
- Ask a question in the #django IRC channel, or search the IRC logs to see if it has been asked before.
- If you notice errors with this documentation, please open a ticket and let us know! Please only use the ticket tracker for criticisms and improvements on the docs. For tech support, use the resources above.