[[TOC()]] = !GeoDjango Installation = !GeoDjango requires the installation of several '''open source geographic libraries''' and a database system with '''spatial extensions''' * Currently PostgreSQL (with PostGIS), MySQL, and Oracle (Spatial/Locator) are supported. * PostgreSQL is the recommended database, having the most mature and feature-rich spatial functions and operators. * Note: Several components of !GeoDjango '''can''' be used without a database (ie. [http://code.google.com/p/geodjango-basic-apps/wiki/GeoIPQuickStart The GeoIP utility]) * GeoDjangoDebianLennyInstall : No compilation required, all the Debian packages work with geodjango out of the box. This section will describe the '''source code''' installation process for these prerequisites. * GeoDjangoUbuntuInstall is another page describing an apt-get approach to installing dependencies == Background == !GeoDjango is best supported using PostgreSQL/PostGIS on Linux/UNIX platforms, but will also run on Windows (with a little more effort). The following platforms have been confirmed to work -- feel free to add to the list: * Linux * Debian Woody (2.4 Kernel) * Debian etch (2.6 Kernel) * [wiki:GeoDjangoDebianLennyInstall Debian Lenny] (2.6 Kernel) * Ubuntu Hardy Heron 8.04 (2.6 Kernel) * Ubuntu 7.0 (2.6 Kernel) * Centos 5 (2.6 Kernel) * White Box Enterprise Linux 3.0 (2.4 Kernel) * openSUSE 10.2 (2.6 Kernel) * Archlinux (2.6 Kernel) * [wiki:GeoDjangoFedoraInstall Fedora 9] (2.6 Kernel) * Mac OS X * 10.4.10 (Tiger) * 10.5 (Leopard) * Solaris 5.11 * Windows XP SP2 == Linux & UNIX Platforms == The official documentation for building from source may be found at [http://geodjango.org/docs/install.html geodjango.org]. Documentation suggestions, comments, and tips may be put here. === GEOS === The GEOS install instructions has moved to [http://geodjango.org/docs/install.html#id6 geodjango.org]. === PROJ.4 === The PROJ.4 install instructions has moved to [http://geodjango.org/docs/install.html#proj-4 geodjango.org]. === PostGIS === The PostGIS install instructions has moved to [http://geodjango.org/docs/install.html#id9 geodjango.org]. === GDAL === The GDAL installation documentation has moved to [http://geodjango.org/docs/install.html#id11 geodjango.org]. == Windows == Please refer to [http://geodjango.org/docs/install.html#windows Windows installation instructions] available at [http://geodjango.org geodjango.org]. == Oracle == !GeoDjango has preliminary support for Oracle Locator/Spatial as of r6524 (though none of the advanced features of Oracle Spatial are utilized). Oracle's express edition (XE) is ''not supported''. Apparently, even though XE supports Locator's `SDO_GEOMETRY` objects and queries, XE does not include support for Java extensions -- which are required to construct and/or extract geometries from WKT. For the sake of simplicity, WKT geometry construction and extraction was used when implementing the [browser:django/branches/gis/django/contrib/gis/db/backend/oracle Oracle spatial backend]. Patches for creating WKT from `SDO_GEOMETRY` statements would be required to extend support for the XE platforms. * ''See'' Siva Rivada's (`sravada`) forum posts in the following Oracle forum threads: "[http://forums.oracle.com/forums/thread.jspa?messageID=1340411� Re: Problem with TO_WKTGEOMETRY/FROM_WKTGEOMETRY]", and "[http://forums.oracle.com/forums/thread.jspa?messageID=1237000� Oracle Database 10g R2 (10.2.0.1) Express Edition (Locator) Available!!]" === Requirements === * Oracle 10g and above with Locator (installation is way beyond the scope of this documentation). * [http://sourceforge.net/project/showfiles.php?group_id=84168 cx_Oracle] 4.3.2 and above. * GEOS (still required for Lazy-Geometries -- see installation instructions above). == Third-Party Library Installation Tests == You can run these tests in order to see if the installation was successful. {{{ $ python }}} {{{ #!python >>> from django.contrib.gis.gdal import HAS_GDAL >>> print HAS_GDAL # Will be False if GDAL libraries are not found True >>> from django.contrib.gis.tests import test_gdal >>> test_gdal.run() }}} If HAS_GDAL == FALSE, see [http://code.djangoproject.com/wiki/GeoDjangoInstall#GDALTroubleshooting GDALTroubleshooting] {{{ #!python >>> from django.contrib.gis.tests import test_geos >>> test_geos.run() }}}