Differences between revisions 1 and 71 (spanning 70 versions)
Revision 1 as of 2007-08-04 15:42:52
Size: 38
Comment:
Revision 71 as of 2010-02-02 18:16:46
Size: 1863
Editor: 129-46-77-48
Comment: fixed the war deployment dead link
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
'''Gaps between Jython and Django''' == Using Django on Jython ==

Finally, Django works on Jython, without any special patching. Here are the steps to get Django on Jython running:

 1. First, get a fresh version of Jython. Any release after 2.5b2 should work fine.

 2. Check out and install Django 1.0.X (The 1.0.2 release mostly work, but you will have to manually apply this patch: http://code.djangoproject.com/ticket/9789 .

    {{{
$ svn co http://code.djangoproject.com/svn/django/branches/releases/1.0.X/ django-1.0.X
$ cd django-1.0.X
$ jython setup.py install
}}}
    
    You may also like to make an alias for "django-admin.py". Very useful if you also use Django with CPython:

    {{{
$ alias django-admin-jy="jython /path/to/jython-dev/dist/bin/django-admin.py"
}}}

 3. Download and install the latest release of django-jython:

    {{{
$ wget http://django-jython.googlecode.com/files/django-jython-1.0b1.tar.gz
$ tar xvfz django-jython-1.0b1.tar.gz
$ cd django-jython-1.0b1
$ jython setup.py install
}}}

 4. Start a project.
    {{{
$ django-admin-jy startproject myproject
}}}

 5. Edit `myproject/settings.py` and change the `DATABASE_ENGINE` to `doj.backends.zxjdbc.postgresql`.

At this point, you can follow the great [[http://djangoproject.com/documentation/|Django documentation]], remembering to use the `jython25` command instead of `python`, and the `JYTHONPATH` variable instead of `PYTHONPATH`. Have fun!

== Deployment ==

See http://packages.python.org/django-jython/war-deployment.html

== Troubleshooting ==

=== Running the test suite on Windows ===

Seems like there is an issue with popen() on windows, which blocks the Django test suite. You can try skipping the offending test using these two patches (against Django 1.0.2), written by Victor Ng:

 * http://tinyurl.com/bqfcco
 * http://tinyurl.com/aarjx2

Using Django on Jython

Finally, Django works on Jython, without any special patching. Here are the steps to get Django on Jython running:

  1. First, get a fresh version of Jython. Any release after 2.5b2 should work fine.
  2. Check out and install Django 1.0.X (The 1.0.2 release mostly work, but you will have to manually apply this patch: http://code.djangoproject.com/ticket/9789 .

    • $ svn co http://code.djangoproject.com/svn/django/branches/releases/1.0.X/ django-1.0.X
      $ cd django-1.0.X
      $ jython setup.py install
      You may also like to make an alias for "django-admin.py". Very useful if you also use Django with CPython:
      $ alias django-admin-jy="jython /path/to/jython-dev/dist/bin/django-admin.py"
  3. Download and install the latest release of django-jython:
    • $ wget http://django-jython.googlecode.com/files/django-jython-1.0b1.tar.gz
      $ tar xvfz django-jython-1.0b1.tar.gz
      $ cd django-jython-1.0b1
      $ jython setup.py install
  4. Start a project.
    • $ django-admin-jy startproject myproject
  5. Edit myproject/settings.py and change the DATABASE_ENGINE to doj.backends.zxjdbc.postgresql.

At this point, you can follow the great Django documentation, remembering to use the jython25 command instead of python, and the JYTHONPATH variable instead of PYTHONPATH. Have fun!

Deployment

See http://packages.python.org/django-jython/war-deployment.html

Troubleshooting

Running the test suite on Windows

Seems like there is an issue with popen() on windows, which blocks the Django test suite. You can try skipping the offending test using these two patches (against Django 1.0.2), written by Victor Ng:

DjangoOnJython (last edited 2014-05-22 23:24:19 by AdamBurke)