Sun GlassFish Enterprise Server v3 Scripting Framework Guide

Using the Django Administration Utility

The previous sections discussed Jython on Django installation and configuration for Sun GlassFish Enterprise Server. To utilize the Django administration utility for creating applications based on a database, you need a database and the JDBC drivers for Jython to connect to that database. The following steps briefly describe the tasks involved:

  1. Install a database such as PostgreSQL.

  2. Create a database instance.

  3. Install django–jython packages for the database connectors, if not already installed.

  4. Edit the settings.py file and configure the database.

  5. Edit the settings.py file and configure the administration utility.

  6. Add the database drivers to the class path to allow Jython to access the database.

  7. Sync the database with the following command:

    jython manage.py syncdb

  8. Edit the urls.py file and uncomment the lines pertaining to the administration utility.

  9. Make the stylesheets available to the Jython container:

    asadmin deploy --property jython.mediaRoot=/jython-install-location/Lib/site-packages/django/contrib/admin/

You can obtain more information on how to install and use databases with Django administration from the following tutorial:

http://weblogs.java.net/blog/vivekp/archive/2009/06/run_django_appl_1.html