Differences between revisions 56 and 57
Revision 56 as of 2008-08-14 09:21:17
Size: 2110
Editor: p4FC1644C
Comment: corrected a typo
Revision 57 as of 2008-08-15 18:41:22
Size: 2284
Editor: 190
Comment: Pointed that Django 1.0-beta1 also works.
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Finally, Django works on Jython, without any special patching. Right now you have to use the development version of both projects, but as soon as Django and Jython ship a new release, you will be able to use that too. Finally, Django works on Jython, without any special patching. Right now it is recommended to use the development version of both projects, but as soon as Django and Jython ship a new stable release, you will be able to use that too.
Line 31: Line 31:
    Note: The [http://www.djangoproject.com/download/1.0-beta-1/tarball/ Django 1.0-beta1] release should also work, if you don't want to follow trunk.
Line 42: Line 44:
$ jython25 setup.py install $ jython25 setup.py install.py

Using Django on Jython

Finally, Django works on Jython, without any special patching. Right now it is recommended to use the development version of both projects, but as soon as Django and Jython ship a new stable release, you will be able to use that too.

So, here are the steps to get Django on Jython running.

  1. First, get a fresh version of Jython, and build it:
    • $ svn co https://jython.svn.sourceforge.net/svnroot/jython/branches/asm/  jython-dev
      $ cd jython-dev
      $ ant

      This should create a dist/ directory inside jython-dev/. The jython "executable" (a shell script, actually) is under dist/bin. You may want to alias the command to avoid typing the whole path each time, with the command:

      $ alias jython25=/path/to/jython-dev/dist/bin/jython

      (or perhaps you prefer to add the directory to your PATH. Anyway, whatever works for you is OK)

  2. Check out and install Django:
    • $ svn co http://code.djangoproject.com/svn/django/trunk/ django-dev
      $ cd django-dev
      $ jython25 setup.py install # Assuming you choose to use the "alias" trick explained on the previous point

      Note: The [http://www.djangoproject.com/download/1.0-beta-1/tarball/ Django 1.0-beta1] release should also work, if you don't want to follow trunk. 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="jython25  /path/to/jython-dev/dist/bin/django-admin.py"
  3. Check out and install django-jython:
    • $ svn co http://django-jython.googlecode.com/svn/trunk/ django-jython
      $ cd django-jython
      $ jython25 setup.py install.py
  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!

Community

[http://pipes.yahoo.com/pipes/pipe.info?_id=jroxOD1f3BGgvtiIqGIyXQ RSS Aggregator for blog posts about Django on Jython]

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