{"title":"Pemasangan GeoDjango","version":"1.9","locale":"id","docname":"ref/contrib/gis/install/index","url":"/id/1.9/ref/contrib/gis/install/","canonical":"https://djangodocs.dev/id/1.9/ref/contrib/gis/install/","summary":"Secara umum, pemasangan GeoDjango membutuhkan: Python dan Django, Basisdata spasial, Installing Geospatial libraries.","html":"<h1>Pemasangan GeoDjango<a class=\"heading-anchor\" href=\"#geodjango-installation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<section id=\"overview\">\n<h2>Ikhtisar<a class=\"heading-anchor\" href=\"#overview\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Secara umum, pemasangan GeoDjango membutuhkan:</p>\n<ol class=\"arabic simple\">\n<li><p><a class=\"reference internal\" href=\"#django\"><span class=\"std std-ref\">Python dan Django</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#spatial-database\"><span class=\"std std-ref\">Basisdata spasial</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/geolibs/\"><span class=\"doc\">Installing Geospatial libraries</span></a></p></li>\n</ol>\n<p>Details for each of the requirements and installation instructions\nare provided in the sections below. In addition, platform-specific\ninstructions are available for:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#macosx\"><span class=\"std std-ref\">Mac OS X</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/testing/#windows\"><span class=\"std std-ref\">Windows</span></a></p></li>\n</ul>\n<aside class=\"admonition-use-the-source admonition\" role=\"note\">\n<p class=\"admonition-title\">Gunakan Sumber</p>\n<p>Because GeoDjango takes advantage of the latest in the open source geospatial\nsoftware technology, recent versions of the libraries are necessary.\nIf binary packages aren't available for your platform, installation from\nsource may be required. When compiling the libraries from source, please\nfollow the directions closely, especially if you're a beginner.</p>\n</aside>\n</section>\n<section id=\"requirements\">\n<h2>Persyaratan<a class=\"heading-anchor\" href=\"#requirements\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"python-and-django\">\n<span id=\"django\"></span><h3>Python dan Django<a class=\"heading-anchor\" href=\"#python-and-django\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Because GeoDjango is included with Django, please refer to Django's\n<a class=\"reference internal\" href=\"/id/1.9/topics/install/#installing-official-release\"><span class=\"std std-ref\">installation instructions</span></a> for details on\nhow to install.</p>\n</section>\n<section id=\"spatial-database\">\n<span id=\"id1\"></span><h3>Basisdata spasial<a class=\"heading-anchor\" href=\"#spatial-database\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>PostgreSQL (with PostGIS), MySQL (mostly with MyISAM engine), Oracle, and SQLite\n(with SpatiaLite) are the spatial databases currently supported.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>PostGIS is recommended, because it is the most mature and feature-rich\nopen source spatial database.</p>\n</aside>\n<p>The geospatial libraries required for a GeoDjango installation depends\non the spatial database used.  The following lists the library requirements,\nsupported versions, and any notes for each of the supported database backends:</p>\n<div class=\"table-scroll\" role=\"region\" tabindex=\"0\" aria-label=\"Table\"><table class=\"docutils align-default\">\n<thead>\n<tr class=\"row-odd\"><th class=\"head\"><p>Basisdata</p></th>\n<th class=\"head\"><p>Persyaratan Pustaka</p></th>\n<th class=\"head\"><p>Versi Didukung</p></th>\n<th class=\"head\"><p>Catatan</p></th>\n</tr>\n</thead>\n<tbody>\n<tr class=\"row-even\"><td><p>PostgreSQL</p></td>\n<td><p>GEOS, PROJ.4, PostGIS</p></td>\n<td><p>9.1+</p></td>\n<td><p>Membutuhkan PostGIS.</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>MySQL</p></td>\n<td><p>GEOS</p></td>\n<td><p>5.5+</p></td>\n<td><p>Not OGC-compliant; <a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/db-api/#mysql-spatial-limitations\"><span class=\"std std-ref\">limited functionality</span></a>.</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>Oracle</p></td>\n<td><p>GEOS</p></td>\n<td><p>11.2+</p></td>\n<td><p>XE tidak didukung.</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>SQLite</p></td>\n<td><p>GEOS, GDAL, PROJ.4, SpatiaLite</p></td>\n<td><p>3.6.+</p></td>\n<td><p>Membutuhkan SpatiaLite 2.4+, pysqlite2 2.5+</p></td>\n</tr>\n</tbody>\n</table>\n</div>\n<p>See also <a class=\"reference external\" href=\"https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS\">this comparison matrix</a> on the OSGeo Wiki for\nPostgreSQL/PostGIS/GEOS/GDAL possible combinations.</p>\n</section>\n</section>\n<section id=\"installation\">\n<h2>Pemasangan<a class=\"heading-anchor\" href=\"#installation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"geospatial-libraries\">\n<h3>Pustaka geospasial<a class=\"heading-anchor\" href=\"#geospatial-libraries\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<div class=\"toctree-wrapper compound\">\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/geolibs/\">Installing Geospatial libraries</a></li>\n</ul>\n</div>\n</section>\n<section id=\"database-installation\">\n<h3>Pemasangan basisdata<a class=\"heading-anchor\" href=\"#database-installation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<div class=\"toctree-wrapper compound\">\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/postgis/\">Memasang PostGIS</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/spatialite/\">Memasang Spatialite</a></li>\n</ul>\n</div>\n</section>\n<section id=\"add-django-contrib-gis-to-installed-apps\">\n<h3>Tambah <code class=\"docutils literal notranslate\">django.contrib.gis</code> ke <a class=\"reference internal\" href=\"/id/1.9/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a><a class=\"heading-anchor\" href=\"#add-django-contrib-gis-to-installed-apps\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Like other Django contrib applications, you will <em>only</em> need to add\n<a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/#module-django.contrib.gis\" title=\"django.contrib.gis: Geographic Information System (GIS) extensions for Django\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.gis</code></a> to <a class=\"reference internal\" href=\"/id/1.9/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a> in your settings.\nThis is so that the <code class=\"docutils literal notranslate\">gis</code> templates can be located -- if not done, then\nfeatures such as the geographic admin or KML sitemaps will not function properly.</p>\n</section>\n</section>\n<section id=\"troubleshooting\">\n<h2>Menyelesaikan masalah<a class=\"heading-anchor\" href=\"#troubleshooting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>If you can't find the solution to your problem here then participate in the\ncommunity!  You can:</p>\n<ul class=\"simple\">\n<li><p>Join the <code class=\"docutils literal notranslate\">#geodjango</code> IRC channel on Freenode. Please be patient and polite\n-- while you may not get an immediate response, someone will attempt to answer\nyour question as soon as they see it.</p></li>\n<li><p>Tanyakan pertanyaan anda pada daftar penyuratan <a class=\"reference external\" href=\"https://groups.google.com/d/forum/geodjango\">GeoDjango</a>.</p></li>\n<li><p>Arsipkan sebuah tiket pada <a class=\"reference external\" href=\"https://code.djangoproject.com/newticket\">Django trac</a> jika anda beripikir ada kesalahan. Pastikan anda menyediakan gambaran lenglap dari masalah, versi yang digunakan, dan tentukan komponen sebagai &quot;GIS&quot;.</p></li>\n</ul>\n<section id=\"library-environment-settings\">\n<span id=\"libsettings\"></span><h3>Pustaka pengaturan lingkungan<a class=\"heading-anchor\" href=\"#library-environment-settings\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>By far, the most common problem when installing GeoDjango is that the\nexternal shared libraries (e.g., for GEOS and GDAL) cannot be located. <a class=\"footnote-reference brackets\" href=\"#id27\" id=\"id5\" role=\"doc-noteref\"><span class=\"fn-bracket\">[</span>1<span class=\"fn-bracket\">]</span></a>\nTypically, the cause of this problem is that the operating system isn't aware\nof the directory where the libraries built from source were installed.</p>\n<p>In general, the library path may be set on a per-user basis by setting\nan environment variable, or by configuring the library path for the entire\nsystem.</p>\n<section id=\"ld-library-path-environment-variable\">\n<h4>Variabel lingkungan <code class=\"docutils literal notranslate\">LD_LIBRARY_PATH</code><a class=\"heading-anchor\" href=\"#ld-library-path-environment-variable\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>A user may set this environment variable to customize the library paths\nthey want to use.  The typical library directory for software\nbuilt from source is <code class=\"docutils literal notranslate\">/usr/local/lib</code>.  Thus, <code class=\"docutils literal notranslate\">/usr/local/lib</code> needs\nto be included in the <code class=\"docutils literal notranslate\">LD_LIBRARY_PATH</code> variable.  For example, the user\ncould place the following in their bash profile:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"go\">export LD_LIBRARY_PATH=/usr/local/lib</span>\n</code></pre></div>\n</section>\n<section id=\"setting-system-library-path\">\n<h4>Menyetel jalur pustakan sistem<a class=\"heading-anchor\" href=\"#setting-system-library-path\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>On GNU/Linux systems, there is typically a file in <code class=\"docutils literal notranslate\">/etc/ld.so.conf</code>, which may include\nadditional paths from files in another directory, such as <code class=\"docutils literal notranslate\">/etc/ld.so.conf.d</code>.\nAs the root user, add the custom library path (like <code class=\"docutils literal notranslate\">/usr/local/lib</code>) on a\nnew line in <code class=\"docutils literal notranslate\">ld.so.conf</code>.  This is <em>one</em> example of how to do so:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>sudo <span class=\"nb\">echo</span> /usr/local/lib &gt;&gt; /etc/ld.so.conf\n<span class=\"gp\">$ </span>sudo ldconfig\n</code></pre></div>\n<p>For OpenSolaris users, the system library path may be modified using the\n<code class=\"docutils literal notranslate\">crle</code> utility.  Run <code class=\"docutils literal notranslate\">crle</code> with no options to see the current configuration\nand use <code class=\"docutils literal notranslate\">crle -l</code> to set with the new library path.  Be <em>very</em> careful when\nmodifying the system library path:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\"># </span>crle -l <span class=\"nv\">$OLD_PATH</span>:/usr/local/lib\n</code></pre></div>\n</section>\n<section id=\"install-binutils\">\n<span id=\"binutils\"></span><h4>Pasang <code class=\"docutils literal notranslate\">binutils</code><a class=\"heading-anchor\" href=\"#install-binutils\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>GeoDjango uses the <code class=\"docutils literal notranslate\">find_library</code> function (from the <code class=\"docutils literal notranslate\">ctypes.util</code> Python\nmodule) to discover libraries.  The <code class=\"docutils literal notranslate\">find_library</code> routine uses a program\ncalled <code class=\"docutils literal notranslate\">objdump</code> (part of the <code class=\"docutils literal notranslate\">binutils</code> package) to verify a shared\nlibrary on GNU/Linux systems.  Thus, if <code class=\"docutils literal notranslate\">binutils</code> is not installed on your\nLinux system then Python's ctypes may not be able to find your library even if\nyour library path is set correctly and geospatial libraries were built perfectly.</p>\n<p>The <code class=\"docutils literal notranslate\">binutils</code> package may be installed on Debian and Ubuntu systems using the\nfollowing command:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>sudo apt-get install binutils\n</code></pre></div>\n<p>Mirip, pada sistem Red Hat dan CentOS:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>sudo yum install binutils\n</code></pre></div>\n</section>\n</section>\n</section>\n<section id=\"platform-specific-instructions\">\n<h2>Platform-specific instructions<a class=\"heading-anchor\" href=\"#platform-specific-instructions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"mac-os-x\">\n<span id=\"macosx\"></span><h3>Mac OS X<a class=\"heading-anchor\" href=\"#mac-os-x\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Because of the variety of packaging systems available for OS X, users have\nseveral different options for installing GeoDjango. These options are:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#postgresapp\"><span class=\"std std-ref\">Postgres.app</span></a> (paling mudah dan dianjurkan)</p></li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/spatialite/#homebrew\"><span class=\"std std-ref\">Homebrew</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/spatialite/#kyngchaos\"><span class=\"std std-ref\">KyngChaos</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#fink\"><span class=\"std std-ref\">Fink</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#macports\"><span class=\"std std-ref\">MacPorts</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/geolibs/#build-from-source\"><span class=\"std std-ref\">Membangun dari sumber</span></a></p></li>\n</ul>\n<p>This section also includes instructions for installing an upgraded version\nof <a class=\"reference internal\" href=\"#macosx-python\"><span class=\"std std-ref\">Python</span></a> from packages provided by the Python Software\nFoundation, however, this is not required.</p>\n<section id=\"python\">\n<span id=\"macosx-python\"></span><h4>Python<a class=\"heading-anchor\" href=\"#python\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Although OS X comes with Python installed, users can use <a class=\"reference external\" href=\"https://www.python.org/ftp/python/\">framework\ninstallers</a> provided by the Python Software Foundation.  An advantage to\nusing the installer is that OS X's Python will remain &quot;pristine&quot; for internal\noperating system use.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>You will need to modify the <code class=\"docutils literal notranslate\">PATH</code> environment variable in your\n<code class=\"docutils literal notranslate\">.profile</code> file so that the new version of Python is used when\n<code class=\"docutils literal notranslate\">python</code> is entered at the command-line:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"go\">export PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH</span>\n</code></pre></div>\n</aside>\n</section>\n<section id=\"postgres-app\">\n<span id=\"postgresapp\"></span><h4>Postgres.app<a class=\"heading-anchor\" href=\"#postgres-app\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p><a class=\"reference external\" href=\"http://postgresapp.com/\">Postgres.app</a> is a standalone PostgreSQL server\nthat includes the PostGIS extension. You will also need to install <code class=\"docutils literal notranslate\">gdal</code> and\n<code class=\"docutils literal notranslate\">libgeoip</code> with <a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/spatialite/#homebrew\"><span class=\"std std-ref\">Homebrew</span></a>.</p>\n<p>After installing Postgres.app, add the following to your <code class=\"docutils literal notranslate\">.bash_profile</code> so\nyou can run the package's programs from the command-line. Replace <code class=\"docutils literal notranslate\">X.Y</code> with\nthe version of PostgreSQL in the Postgres.app you installed:</p>\n<div class=\"code-block\" data-language=\"bash\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"nb\">export</span> <span class=\"nv\">PATH</span><span class=\"o\">=</span><span class=\"nv\">$PATH</span>:/Applications/Postgres.app/Contents/Versions/X.Y/bin\n</code></pre></div>\n<p>You can check if the path is set up correctly by typing <code class=\"docutils literal notranslate\">which psql</code> at a\nterminal prompt.</p>\n</section>\n<section id=\"homebrew\">\n<span id=\"id8\"></span><h4>Homebrew<a class=\"heading-anchor\" href=\"#homebrew\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p><a class=\"reference external\" href=\"http://brew.sh/\">Homebrew</a> provides &quot;recipes&quot; for building binaries and packages from source.\nIt provides recipes for the GeoDjango prerequisites on Macintosh computers\nrunning OS X. Because Homebrew still builds the software from source, the\n<a class=\"reference external\" href=\"https://developer.apple.com/technologies/tools/\">Apple Developer Tools</a> are required.</p>\n<p>Ringkasan:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>brew install postgresql\n<span class=\"gp\">$ </span>brew install postgis\n<span class=\"gp\">$ </span>brew install gdal\n<span class=\"gp\">$ </span>brew install libgeoip\n</code></pre></div>\n</section>\n<section id=\"kyngchaos-packages\">\n<span id=\"kyngchaos\"></span><h4>Paket KyngChaos<a class=\"heading-anchor\" href=\"#kyngchaos-packages\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>William Kyngesburye provides a number of <a class=\"reference external\" href=\"http://www.kyngchaos.com/software/frameworks\">geospatial library binary packages</a>\nthat make it simple to get GeoDjango installed on OS X without compiling\nthem from source.  However, the <a class=\"reference external\" href=\"https://developer.apple.com/technologies/tools/\">Apple Developer Tools</a> are still necessary\nfor compiling the Python database adapters <a class=\"reference internal\" href=\"#psycopg2-kyngchaos\"><span class=\"std std-ref\">psycopg2</span></a> (for PostGIS)\nand <a class=\"reference external\" href=\"https://pypi.python.org/pypi/pysqlite\">pysqlite2</a> (for SpatiaLite).</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>SpatiaLite users should consult the <a class=\"reference internal\" href=\"/id/1.9/ref/contrib/gis/install/spatialite/#spatialite-macosx\"><span class=\"std std-ref\">Mac OS X-specific instructions</span></a> section\nafter installing the packages for additional instructions.</p>\n</aside>\n<p>Unduh paket kerangka untuk:</p>\n<ul class=\"simple\">\n<li><p>UnixImageIO</p></li>\n<li><p>PROJ</p></li>\n<li><p>GEOS</p></li>\n<li><p>SQLite3 (menyertakan pustaka SpatiaLite)</p></li>\n<li><p>GDAL</p></li>\n</ul>\n<p>Install the packages in the order they are listed above, as the GDAL and SQLite\npackages require the packages listed before them.</p>\n<p>Afterwards, you can also install the KyngChaos binary packages for <a class=\"reference external\" href=\"http://www.kyngchaos.com/software/postgres\">PostgreSQL\nand PostGIS</a>.</p>\n<p>After installing the binary packages, you'll want to add the following to\nyour <code class=\"docutils literal notranslate\">.profile</code> to be able to run the package programs from the command-line:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"go\">export PATH=/Library/Frameworks/UnixImageIO.framework/Programs:$PATH</span>\n<span class=\"go\">export PATH=/Library/Frameworks/PROJ.framework/Programs:$PATH</span>\n<span class=\"go\">export PATH=/Library/Frameworks/GEOS.framework/Programs:$PATH</span>\n<span class=\"go\">export PATH=/Library/Frameworks/SQLite3.framework/Programs:$PATH</span>\n<span class=\"go\">export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH</span>\n<span class=\"go\">export PATH=/usr/local/pgsql/bin:$PATH</span>\n</code></pre></div>\n<section id=\"psycopg2\">\n<span id=\"psycopg2-kyngchaos\"></span><h5>psycopg2<a class=\"heading-anchor\" href=\"#psycopg2\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p>After you've installed the KyngChaos binaries and modified your <code class=\"docutils literal notranslate\">PATH</code>, as\ndescribed above, <code class=\"docutils literal notranslate\">psycopg2</code> may be installed using the following command:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>pip install psycopg2\n</code></pre></div>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>If you don't have <code class=\"docutils literal notranslate\">pip</code>, follow the <a class=\"reference internal\" href=\"/id/1.9/topics/install/#installing-official-release\"><span class=\"std std-ref\">installation instructions</span></a> to install it.</p>\n</aside>\n</section>\n<section id=\"fink\">\n<span id=\"id12\"></span><h5>Fink<a class=\"heading-anchor\" href=\"#fink\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<p><a class=\"reference external\" href=\"https://schwehr.blogspot.com/\">Kurt Schwehr</a> has been gracious enough to create GeoDjango packages for users\nof the <a class=\"reference external\" href=\"http://www.finkproject.org/\">Fink</a> package system. <a class=\"reference external\" href=\"http://pdb.finkproject.org/pdb/browse.php?summary=django-gis\">Different packages are available</a> (starting\nwith &quot;django-gis&quot;), depending on which version of Python you want to use.</p>\n</section>\n</section>\n<section id=\"macports\">\n<span id=\"id16\"></span><h4>MacPorts<a class=\"heading-anchor\" href=\"#macports\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p><a class=\"reference external\" href=\"https://www.macports.org/\">MacPorts</a> may be used to install GeoDjango prerequisites on Macintosh\ncomputers running OS X.  Because MacPorts still builds the software from source,\nthe <a class=\"reference external\" href=\"https://developer.apple.com/technologies/tools/\">Apple Developer Tools</a> are required.</p>\n<p>Ringkasan:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>sudo port install postgresql93-server\n<span class=\"gp\">$ </span>sudo port install geos\n<span class=\"gp\">$ </span>sudo port install proj\n<span class=\"gp\">$ </span>sudo port install postgis\n<span class=\"gp\">$ </span>sudo port install gdal +geos\n<span class=\"gp\">$ </span>sudo port install libgeoip\n</code></pre></div>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>You will also have to modify the <code class=\"docutils literal notranslate\">PATH</code> in your <code class=\"docutils literal notranslate\">.profile</code> so\nthat the MacPorts programs are accessible from the command-line:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"go\">export PATH=/opt/local/bin:/opt/local/lib/postgresql93/bin</span>\n</code></pre></div>\n<p>In addition, add the <code class=\"docutils literal notranslate\">DYLD_FALLBACK_LIBRARY_PATH</code> setting so that\nthe libraries can be found by Python:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"go\">export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib:/opt/local/lib/postgresql93</span>\n</code></pre></div>\n</aside>\n</section>\n</section>\n<section id=\"windows\">\n<span id=\"id18\"></span><h3>Windows<a class=\"heading-anchor\" href=\"#windows\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Proceed through the following sections sequentially in order to install\nGeoDjango on Windows.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>These instructions assume that you are using 32-bit versions of\nall programs.  While 64-bit versions of Python and PostgreSQL 9.x\nare available, 64-bit versions of spatial libraries, like\nGEOS and GDAL, are not yet provided by the <a class=\"reference internal\" href=\"#osgeo4w\"><span class=\"std std-ref\">OSGeo4W</span></a> installer.</p>\n</aside>\n<section id=\"id19\">\n<h4>Python<a class=\"heading-anchor\" href=\"#id19\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Pertama, unduh <a class=\"reference external\" href=\"https://python.org/download/\">Python 2.7 installer</a> terakhir dari situs jaringan Python. Selanjutnya, jalankan pemasang dan jaga awalnya -- sebagai contoh, jaga 'Install for all users' tercentang dan jalur pemasangan disetel sebagai <code class=\"docutils literal notranslate\">C:\\Python27</code>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>Anda mungkin mempunyai versi Python terpasang di <code class=\"docutils literal notranslate\">C:\\Python</code> sebagai produk ESRI terkadang memasang salinan disana. <em>Anda harus masih memasang versi segar dari Python 2.7.</em></p>\n</aside>\n</section>\n<section id=\"postgresql\">\n<h4>PostgreSQL<a class=\"heading-anchor\" href=\"#postgresql\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Pertama, unduh <a class=\"reference external\" href=\"http://www.enterprisedb.com/products-services-training/pgdownload\">PostgreSQL 9.x installer</a> terakhir dari situs jaringan <a class=\"reference external\" href=\"http://www.enterprisedb.com\">EnterpriseDB</a>. Setelah mengunduh, cukup jalankan pemasang, ikuti arahan layar, dan jaga pilihan awal kecuali kalau anda mengetahui konsekuensi merubah mereka.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>Pemasang PostgreSQL membuat kedua pengguna Windows baru menjadi 'postgres service account' dan superuser basisdata <code class=\"docutils literal notranslate\">postgres</code>. Anda akan diarahkan sekali untuk menyetel sandi untuk kedua akun -- pastikan untuk mengingatnya!</p>\n</aside>\n<p>Ketika pemasang lengkap, dia akan menanyakan untuk meluncurkan Application Stack Builder (ASB) pada keluar -- jaga ini tercentang, seperti dia diperlukan untuk memasang install <a class=\"reference internal\" href=\"#postgisasb\"><span class=\"std std-ref\">PostGIS</span></a>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>Jika berhasil terpasang, peladen PostgreSQL akan berjalan dalam latar belakang setiap kali sistem dimulai sebagai layanan Window. Sebuah kelompok menu mulai <span class=\"menuselection\">PostgreSQL 9.x</span> akan dibuat dan mengandung jalan pintas untuk ASB dan juga 'SQL Shell', yang akan meluncurkan jendela perintah <code class=\"docutils literal notranslate\">psql</code>.</p>\n</aside>\n</section>\n<section id=\"postgis\">\n<span id=\"postgisasb\"></span><h4>PostGIS<a class=\"heading-anchor\" href=\"#postgis\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>From within the Application Stack Builder (to run outside of the installer,\n<span class=\"menuselection\">Start ‣ Programs ‣ PostgreSQL 9.x</span>), select\n<span class=\"menuselection\">PostgreSQL Database Server 9.x on port 5432</span> from the drop down\nmenu.  Next, expand the <span class=\"menuselection\">Categories ‣ Spatial Extensions</span> menu\ntree and select <span class=\"menuselection\">PostGIS X.Y for PostgreSQL 9.x</span>.</p>\n<p>After clicking next, you will be prompted to select your mirror, PostGIS\nwill be downloaded, and the PostGIS installer will begin.  Select only the\ndefault options during install (e.g., do not uncheck the option to create a\ndefault PostGIS database).</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>You will be prompted to enter your <code class=\"docutils literal notranslate\">postgres</code> database superuser\npassword in the 'Database Connection Information' dialog.</p>\n</aside>\n</section>\n<section id=\"id23\">\n<h4>psycopg2<a class=\"heading-anchor\" href=\"#id23\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>The <code class=\"docutils literal notranslate\">psycopg2</code> Python module provides the interface between Python and the\nPostgreSQL database.  Download the latest <a class=\"reference external\" href=\"http://www.stickpeople.com/projects/python/win-psycopg/\">Windows installer</a> for your version\nof Python and PostgreSQL and run using the default settings. <a class=\"footnote-reference brackets\" href=\"#id28\" id=\"id24\" role=\"doc-noteref\"><span class=\"fn-bracket\">[</span>2<span class=\"fn-bracket\">]</span></a></p>\n</section>\n<section id=\"osgeo4w\">\n<span id=\"id26\"></span><h4>OSGeo4W<a class=\"heading-anchor\" href=\"#osgeo4w\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>The <a class=\"reference external\" href=\"https://trac.osgeo.org/osgeo4w/\">OSGeo4W installer</a> makes it simple to install the PROJ.4, GDAL, and GEOS\nlibraries required by GeoDjango.  First, download the <a class=\"reference external\" href=\"https://trac.osgeo.org/osgeo4w/\">OSGeo4W installer</a>,\nand run it.  Select <span class=\"menuselection\">Express Web-GIS Install</span> and click next.\nIn the 'Select Packages' list, ensure that GDAL is selected; MapServer and\nApache are also enabled by default, but are not required by GeoDjango and\nmay be unchecked safely.  After clicking next, the packages will be\nautomatically downloaded and installed, after which you may exit the\ninstaller.</p>\n</section>\n<section id=\"modify-windows-environment\">\n<h4>Merubah lingkungan Windows<a class=\"heading-anchor\" href=\"#modify-windows-environment\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>In order to use GeoDjango, you will need to add your Python and OSGeo4W\ndirectories to your Windows system <code class=\"docutils literal notranslate\">Path</code>, as well as create <code class=\"docutils literal notranslate\">GDAL_DATA</code>\nand <code class=\"docutils literal notranslate\">PROJ_LIB</code> environment variables.  The following set of commands,\nexecutable with <code class=\"docutils literal notranslate\">cmd.exe</code>, will set this up:</p>\n<div class=\"code-block\" data-language=\"bat\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Bat</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Bat code\"><code><span class=\"k\">set</span> <span class=\"nv\">OSGEO4W_ROOT</span><span class=\"p\">=</span>C:\\OSGeo4W\n<span class=\"k\">set</span> <span class=\"nv\">PYTHON_ROOT</span><span class=\"p\">=</span>C:\\Python27\n<span class=\"k\">set</span> <span class=\"nv\">GDAL_DATA</span><span class=\"p\">=</span><span class=\"nv\">%OSGEO4W_ROOT%</span>\\share\\gdal\n<span class=\"k\">set</span> <span class=\"nv\">PROJ_LIB</span><span class=\"p\">=</span><span class=\"nv\">%OSGEO4W_ROOT%</span>\\share\\proj\n<span class=\"k\">set</span> <span class=\"nv\">PATH</span><span class=\"p\">=</span><span class=\"nv\">%PATH%</span>;<span class=\"nv\">%PYTHON_ROOT%</span>;<span class=\"nv\">%OSGEO4W_ROOT%</span>\\bin\nreg ADD <span class=\"s2\">&quot;HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment&quot;</span> /v Path /t REG_EXPAND_SZ /f /d <span class=\"s2\">&quot;</span><span class=\"nv\">%PATH%</span><span class=\"s2\">&quot;</span>\nreg ADD <span class=\"s2\">&quot;HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment&quot;</span> /v GDAL_DATA /t REG_EXPAND_SZ /f /d <span class=\"s2\">&quot;</span><span class=\"nv\">%GDAL_DATA%</span><span class=\"s2\">&quot;</span>\nreg ADD <span class=\"s2\">&quot;HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment&quot;</span> /v PROJ_LIB /t REG_EXPAND_SZ /f /d <span class=\"s2\">&quot;</span><span class=\"nv\">%PROJ_LIB%</span><span class=\"s2\">&quot;</span>\n</code></pre></div>\n<p>For your convenience, these commands are available in the executable batch\nscript, <a class=\"reference download internal\" download=\"\" href=\"/id/1.9/_downloads/57181c980b5f38228d80d63d5acaa2ca/geodjango_setup.bat\"><code class=\"xref download docutils literal notranslate\">geodjango_setup.bat</code></a>.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>Administrator privileges are required to execute these commands.\nTo do this, right-click on <a class=\"reference download internal\" download=\"\" href=\"/id/1.9/_downloads/57181c980b5f38228d80d63d5acaa2ca/geodjango_setup.bat\"><code class=\"xref download docutils literal notranslate\">geodjango_setup.bat</code></a> and select\n<span class=\"menuselection\">Run as administrator</span>. You need to log out and log back in again\nfor the settings to take effect.</p>\n</aside>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>If you customized the Python or OSGeo4W installation directories,\nthen you will need to modify the <code class=\"docutils literal notranslate\">OSGEO4W_ROOT</code> and/or <code class=\"docutils literal notranslate\">PYTHON_ROOT</code>\nvariables accordingly.</p>\n</aside>\n</section>\n<section id=\"install-django-and-set-up-database\">\n<h4>Pasang Django dan setel basisdata<a class=\"heading-anchor\" href=\"#install-django-and-set-up-database\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Akhirnya, <a class=\"reference internal\" href=\"/id/1.9/topics/install/#installing-official-release\"><span class=\"std std-ref\">pasang Django</span></a> di sistem anda.</p>\n<p class=\"rubric\">Catatan kaki</p>\n<aside class=\"footnote-list brackets\">\n<aside class=\"footnote brackets\" id=\"id27\" role=\"doc-footnote\">\n<span class=\"label\"><span class=\"fn-bracket\">[</span><a role=\"doc-backlink\" href=\"#id5\">1</a><span class=\"fn-bracket\">]</span></span>\n<p>GeoDjango menggunakan rutin <a class=\"reference external\" href=\"https://docs.python.org/3/library/ctypes.html#ctypes.util.find_library\" title=\"(di Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">find_library()</code></a> dari <code class=\"docutils literal notranslate\">ctypes.util</code> untuk menempatkan pustaka dibagi.</p>\n</aside>\n<aside class=\"footnote brackets\" id=\"id28\" role=\"doc-footnote\">\n<span class=\"label\"><span class=\"fn-bracket\">[</span><a role=\"doc-backlink\" href=\"#id24\">2</a><span class=\"fn-bracket\">]</span></span>\n<p>Pemasang Windows``psycopg2`` dipanketkan dan dirawat oleh <a class=\"reference external\" href=\"http://www.stickpeople.com/projects/python/win-psycopg/\">Jason Erickson</a>.</p>\n</aside>\n</aside>\n</section>\n</section>\n</section>","rootId":"geodjango-installation","toc":[{"title":"Ikhtisar","anchor":"overview","children":[]},{"title":"Persyaratan","anchor":"requirements","children":[{"title":"Python dan Django","anchor":"python-and-django","children":[]},{"title":"Basisdata spasial","anchor":"spatial-database","children":[]}]},{"title":"Pemasangan","anchor":"installation","children":[{"title":"Pustaka geospasial","anchor":"geospatial-libraries","children":[]},{"title":"Pemasangan basisdata","anchor":"database-installation","children":[]},{"title":"Tambah django.contrib.gis ke INSTALLED_APPS","anchor":"add-django-contrib-gis-to-installed-apps","children":[]}]},{"title":"Menyelesaikan masalah","anchor":"troubleshooting","children":[{"title":"Pustaka pengaturan lingkungan","anchor":"library-environment-settings","children":[{"title":"Variabel lingkungan LD_LIBRARY_PATH","anchor":"ld-library-path-environment-variable","children":[]},{"title":"Menyetel jalur pustakan sistem","anchor":"setting-system-library-path","children":[]},{"title":"Pasang binutils","anchor":"install-binutils","children":[]}]}]},{"title":"Platform-specific instructions","anchor":"platform-specific-instructions","children":[{"title":"Mac OS X","anchor":"mac-os-x","children":[{"title":"Python","anchor":"python","children":[]},{"title":"Postgres.app","anchor":"postgres-app","children":[]},{"title":"Homebrew","anchor":"homebrew","children":[]},{"title":"Paket KyngChaos","anchor":"kyngchaos-packages","children":[{"title":"psycopg2","anchor":"psycopg2","children":[]},{"title":"Fink","anchor":"fink","children":[]}]},{"title":"MacPorts","anchor":"macports","children":[]}]},{"title":"Windows","anchor":"windows","children":[{"title":"Python","anchor":"id19","children":[]},{"title":"PostgreSQL","anchor":"postgresql","children":[]},{"title":"PostGIS","anchor":"postgis","children":[]},{"title":"psycopg2","anchor":"id23","children":[]},{"title":"OSGeo4W","anchor":"osgeo4w","children":[]},{"title":"Merubah lingkungan Windows","anchor":"modify-windows-environment","children":[]},{"title":"Pasang Django dan setel basisdata","anchor":"install-django-and-set-up-database","children":[]}]}]}],"breadcrumbs":[{"docname":"ref/index","title":"Acuan API","url":"/id/1.9/ref/"},{"docname":"ref/contrib/index","title":"Paket contrib","url":"/id/1.9/ref/contrib/"},{"docname":"ref/contrib/gis/index","title":"GeoDjango","url":"/id/1.9/ref/contrib/gis/"}],"prev":{"docname":"ref/contrib/gis/tutorial","title":"Tutorial GeoDjango","url":"/id/1.9/ref/contrib/gis/tutorial/"},"next":{"docname":"ref/contrib/gis/install/geolibs","title":"Installing Geospatial libraries","url":"/id/1.9/ref/contrib/gis/install/geolibs/"},"formats":{"html":"/id/1.9/ref/contrib/gis/install/","markdown":"/id/1.9/ref/contrib/gis/install.md","json":"/id/1.9/ref/contrib/gis/install.json"},"source":"https://github.com/django/django/blob/stable/1.9.x/docs/ref/contrib/gis/install/index.txt","official":"https://docs.djangoproject.com/id/1.9/ref/contrib/gis/install/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","fr","ja","id","pt-br","es"]}