Jython and Django installation on GlassFish Server comprises several substeps:
Jython can be installed in either of the following ways:
As a standalone product
From GlassFish Server Update Tool
The following sections explain these tasks in more detail.
You can download Jython and install it as a standalone product. If Jython is installed as standalone, you need to perform additional configuration steps so GlassFish Server can use the Jython installation.
Download Jython from the following location:
http://downloads.sourceforge.net/project/jython/jython/2.5.1/jython_installer-2.5.1.jar
Run the installer as follows:
java -jar jython_installer-2.5.1.jar |
Set the following environmental variables:
Set the JYTHON_HOME variable to the Jython install location:
export JYTHON_HOME=jython-install-location |
Add the JYTHON_HOME/bin directory to the path:
export PATH=$JYTHON_HOME/bin:$PATH |
You should now be able to invoke Jython from command line as follows:
jython |
Configure GlassFish Server to use the Jython installation with the following command:
asadmin deploy --property jython.home=jython-install-location |
The GlassFish Server Update Tool provides a Jython package. This package installs a Jython instance that enables creation of Jython applications for GlassFish Server. If you installed Jython from Update Tool, there is no need for further configuration of the jython.home property.
Start Update Tool with the following command:
as-install/bin/updatetool |
Choose the following option from Available Add-ons and click Install:
Jython Runtime IPS package for GlassFish v3 |
Update center automatically completes the installation of the container and configures it for use with GlassFish Server.
Set the following environmental variables:
Set the JYTHON_HOME variable to the Jython install location:
export JYTHON_HOME=as-install/glassfish/jython |
Add the JYTHON_HOME/bin directory to the path:
export PATH=$JYTHON_HOME/bin:$PATH |
You should now be able to invoke Jython from command line as follows:
jython |
Download Django from the following location:
http://media.djangoproject.com/releases/1.1.1/Django-1.1.1.tar.gz.
Extract the tar file:
gunzip Django-1.1.1.tar.gz tar -xvf Django-1.1.1.tar |
Change to the extracted directory:
cd Django-1.1.1 |
Install Django with the following command:
jython setup.py install |
The GlassFish Server Update Tool provides a Jython container package. The following procedure explains how to install the Jython Container module and Grizzly adapter JAR files in the as-install/glassfish/modules directory, and enable deployment of Jython/Django applications on GlassFish Server.
Start Update Tool with the following command:
as-install/bin/updatetool |
Choose the following option from Available Add-ons and click Install:
GlassFish V3 Jython Container |
Update Tool automatically completes the installation of the container and configures it for use with GlassFish Server.
Start the GlassFish Server:
as-install/bin/asadmin start-domain -v |
Test the configuration:
The django-jython project created database backends and management commands for Django and Jython application development. With this task you can install the django-jython packages and enable database support for Django.
Download the django-jython packages from the following location:
http://django-jython.googlecode.com/files/django-jython-1.0.0.tar.gz
Extract the tar file:
gunzip django-jython-1.0.0.tar.gz tar -xvf django-jython-1.0.0.tar |
Change to the extracted directory:
cd django-jython-1.0.0 |
Install the package:
jython setup.py install |