PageRenderTime 40ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

Plain Text | 73 lines | 51 code | 22 blank | 0 comment | 0 complexity | 6996cf020041a85dc5e6004f0807a376 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. ========================
  2. Running Django on Jython
  3. ========================
  4. .. index:: Jython, Java, JVM
  5. Jython_ is an implementation of Python that runs on the Java platform (JVM).
  6. Django runs cleanly on Jython version 2.5 or later, which means you can deploy
  7. Django on any Java platform.
  8. This document will get you up and running with Django on top of Jython.
  9. .. _jython:
  10. Installing Jython
  11. =================
  12. Django works with Jython versions 2.5b3 and higher. Download Jython at
  14. Creating a servlet container
  15. ============================
  16. If you just want to experiment with Django, skip ahead to the next section;
  17. Django includes a lightweight Web server you can use for testing, so you won't
  18. need to set up anything else until you're ready to deploy Django in production.
  19. If you want to use Django on a production site, use a Java servlet container,
  20. such as `Apache Tomcat`_. Full JavaEE applications servers such as `GlassFish`_
  21. or `JBoss`_ are also OK, if you need the extra features they include.
  22. .. _`Apache Tomcat`:
  23. .. _GlassFish:
  24. .. _JBoss:
  25. Installing Django
  26. =================
  27. The next step is to install Django itself. This is exactly the same as
  28. installing Django on standard Python, so see
  29. :ref:`removing-old-versions-of-django` and :ref:`install-django-code` for
  30. instructions.
  31. Installing Jython platform support libraries
  32. ============================================
  33. The `django-jython`_ project contains database backends and management commands
  34. for Django/Jython development. Note that the builtin Django backends won't work
  35. on top of Jython.
  36. .. _`django-jython`:
  37. To install it, follow the `installation instructions`_ detailed on the project
  38. Web site. Also, read the `database backends`_ documentation there.
  39. .. _`installation instructions`:
  40. .. _`database backends`:
  41. Differences with Django on Jython
  42. =================================
  43. .. index:: JYTHONPATH
  44. At this point, Django on Jython should behave nearly identically to Django
  45. running on standard Python. However, are a few differences to keep in mind:
  46. * Remember to use the ``jython`` command instead of ``python``. The
  47. documentation uses ``python`` for consistency, but if you're using Jython
  48. you'll want to mentally replace ``python`` with ``jython`` every time it
  49. occurs.
  50. * Similarly, you'll need to use the ``JYTHONPATH`` environment variable
  51. instead of ``PYTHONPATH``.