티스토리 수익 글 보기
Until September 10, get PyCharm for 30% off!
🎁 Now includes renewals, and 100% of the purchase price goes directly to the DSF.
Running Django on Jython¶
Jython is an implementation of Python that runs on the Java platform (JVM). This document will get you up and running with Django on top of Jython.
Installing Jython¶
Django works with Jython versions 2.7b2 and higher. See the Jython website for download and installation instructions.
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 Django¶
The next step is to install Django itself. This is exactly the same as installing Django on standard Python, so see Remove any old versions of Django and Install the Django code for instructions.
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.
To install it, follow the installation instructions detailed on the project website. Also, read the database backends documentation there.
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
jythoncommand instead ofpython. The documentation usespythonfor consistency, but if you’re using Jython you’ll want to mentally replacepythonwithjythonevery time it occurs. - Similarly, you’ll need to use the
JYTHONPATHenvironment variable instead ofPYTHONPATH. - Any part of Django that requires Pillow will not work.
Additional Information
Support Django!
Contents
Getting help
- FAQ
- Try the FAQ — it’s got answers to many common questions.
- Index, Module Index, or Table of Contents
- Handy when looking for specific information.
- Django Discord Server
- Join the Django Discord Community.
- Official Django Forum
- Join the community on the Django Forum.
- Ticket tracker
- Report bugs with Django or Django documentation in our ticket tracker.
Download:
Offline (Django 1.10):
HTML |
PDF |
ePub
Provided by Read the Docs.