{"title":"Pemasangan GeoDjango","version":"4.2","locale":"id","docname":"ref/contrib/gis/install/index","url":"/id/4.2/ref/contrib/gis/install/","canonical":"https://djangodocs.dev/id/4.2/ref/contrib/gis/install/","summary":"Ikhtisar Link to this heading # Secara umum, pemasangan GeoDjango membutuhkan: Python dan Django Basisdata spasial Memasang pustaka Geospatial Rincian untuk setiap…","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/4.2/ref/contrib/gis/install/geolibs/\"><span class=\"doc\">Memasang pustaka Geospatial</span></a></p></li>\n</ol>\n<p>Rincian untuk setiap dari persyaratan dan petunjuk pemasangan disediakan di bagian dibawah. Sebagai tambahan, petunjuk khusus-serambi tersedia untuk:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"#macos\"><span class=\"std std-ref\">macOS</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"#windows\"><span class=\"std std-ref\">Windows</span></a></p></li>\n</ul>\n<aside class=\"admonition-use-the-source admonition\">\n<p class=\"admonition-title\">Gunakan Sumber</p>\n<p>Karena GeoDjango mengambil keuntungan dari terkahir di teknologi perangkat lunak geospasial sumber terbuka, versi terakhir dari pustaka dibutuhkan. Jika paket biner tidak tersedia di serambi anda, pemasangan dari sumber mungkin dibutuhkan. Ketika menyusun pustaka dari sumber, harap ikuti petunjuk dengan teliti, khususnya jika anda adalah seorang pemula.</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>Karena GeoDjango disertakan dengan Django, harap mengacu pada <a class=\"reference internal\" href=\"/id/4.2/topics/install/#installing-official-release\"><span class=\"std std-ref\">installation instructions</span></a>  Django untuk rincian bagaimana memasang.</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, Oracle, and SQLite (with SpatiaLite) are the\nspatial databases currently supported.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>PostGIS dianjurkan, karena itu adalah paling matang dan basisdata spasial sumber terbuka kaya-fitur.</p>\n</aside>\n<p>Pustaka-pustaka gespasial dibutuhkan untuk pemasangan GeoDjango tergantung pada basisdata spasial digunakan. Daftar berikut persyaratan pustaka, versi didukung, dan catatan apapun untuk setiap dari backend basisdata didukung:</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, GDAL, PROJ, PostGIS</p></td>\n<td><p>12+</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, GDAL</p></td>\n<td><p>8+</p></td>\n<td><p><a class=\"reference internal\" href=\"/id/4.2/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, GDAL</p></td>\n<td><p>19+</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, SpatiaLite</p></td>\n<td><p>3.21.0+</p></td>\n<td><p>Membutuhkan SpatiaLite 4.3+</p></td>\n</tr>\n</tbody>\n</table>\n</div>\n<p>Lihat juga <a class=\"reference external\" href=\"https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS\">this comparison matrix</a> pada Wiki OSGeo untuk PostgreSQL/PostGIS/GEOS/GDAL kemungkinan perpaduan.</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/4.2/ref/contrib/gis/install/geolibs/\">Memasang pustaka Geospatial</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/4.2/ref/contrib/gis/install/postgis/\">Memasang PostGIS</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"/id/4.2/ref/contrib/gis/install/spatialite/\">Memasang SpatiaLite</a></li>\n</ul>\n</div>\n</section>\n<section id=\"databases-configuration\">\n<h3>Konfigurasi <a class=\"reference internal\" href=\"/id/4.2/ref/settings/#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">DATABASES</span></code></a><a class=\"heading-anchor\" href=\"#databases-configuration\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Setel pengaturan <a class=\"reference internal\" href=\"/id/4.2/ref/settings/#std-setting-DATABASE-ENGINE\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">ENGINE</span></code></a> menjadi satu dari the <a class=\"reference internal\" href=\"/id/4.2/ref/contrib/gis/db-api/#spatial-backends\"><span class=\"std std-ref\">spatial backends</span></a>.</p>\n</section>\n<section id=\"add-django-contrib-gis-to-installed-apps\">\n<h3>Tambah <code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.gis</span></code> ke <a class=\"reference internal\" href=\"/id/4.2/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">INSTALLED_APPS</span></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>Seperti aplikasi bantuan Django lain, anda akan <em>hanya</em> butuh menambahkan <a class=\"reference internal\" href=\"/id/4.2/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\"><span class=\"pre\">django.contrib.gis</span></code></a> ke <a class=\"reference internal\" href=\"/id/4.2/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">INSTALLED_APPS</span></code></a> dalam pengaturan anda. Ini sehingga cetakan <code class=\"docutils literal notranslate\"><span class=\"pre\">gis</span></code> dapat ditempatkan -- jika belum selesai, kemudian fitur-fitur seperti admin georgafis atau peta situs KML tidak akan berfungsi dengan baik.</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>Jika anda tidak dapat menemukan pemecahan padamasalah anda disini lalu ikut serta di komunitas! Anda dapat:</p>\n<ul class=\"simple\">\n<li><p>Join the <code class=\"docutils literal notranslate\"><span class=\"pre\">#django-geo</span></code> IRC channel on Libera.Chat. Please be patient and\npolite -- while you may not get an immediate response, someone will attempt\nto answer your question as soon as they see it.</p></li>\n<li><p>Ask your question on the <a class=\"reference external\" href=\"https://forum.djangoproject.com/c/internals/geodjango/13\">GeoDjango</a> forum.</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>Sejauh ini, masalah paling umum ketika memasang GeoDjango adalah bahwa pustaka-pustaka berbagi eksternal (misalnya, untuk GEOS dan GDAL) tidak dapat ditempatkan. <a class=\"footnote-reference brackets\" href=\"#id22\" id=\"id5\" role=\"doc-noteref\"><span class=\"fn-bracket\">[</span>1<span class=\"fn-bracket\">]</span></a> Khususnya, penyebab masalah ini adalah bahwa sistem operasi tidak waspada dari direktori dimana pustaka-pustaka dibangun dari sumber yang dipasang.</p>\n<p>Secara umum, jalur pustaka mungkin disetel pada dasar per-pengguna dengan mengatur varibel lingkungan, atau dengan mengkonfigurasi jalur pustaka untuk sistem kesulurhan.</p>\n<section id=\"ld-library-path-environment-variable\">\n<h4>Variabel lingkungan <code class=\"docutils literal notranslate\"><span class=\"pre\">LD_LIBRARY_PATH</span></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\"><span class=\"pre\">/usr/local/lib</span></code>.  Thus, <code class=\"docutils literal notranslate\"><span class=\"pre\">/usr/local/lib</span></code> needs\nto be included in the <code class=\"docutils literal notranslate\"><span class=\"pre\">LD_LIBRARY_PATH</span></code> variable.  For example, the user\ncould place the following in their bash profile:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span><span class=\"nv\">LD_LIBRARY_PATH</span><span class=\"o\">=</span>/usr/local/lib\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\"><span class=\"pre\">/etc/ld.so.conf</span></code>, which may include\nadditional paths from files in another directory, such as <code class=\"docutils literal notranslate\"><span class=\"pre\">/etc/ld.so.conf.d</span></code>.\nAs the root user, add the custom library path (like <code class=\"docutils literal notranslate\"><span class=\"pre\">/usr/local/lib</span></code>) on a\nnew line in <code class=\"docutils literal notranslate\"><span class=\"pre\">ld.so.conf</span></code>.  This is <em>one</em> example of how to do so:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span>sudo<span class=\"w\"> </span><span class=\"nb\">echo</span><span class=\"w\"> </span>/usr/local/lib<span class=\"w\"> </span>&gt;&gt;<span class=\"w\"> </span>/etc/ld.so.conf\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>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\"><span class=\"pre\">crle</span></code> utility.  Run <code class=\"docutils literal notranslate\"><span class=\"pre\">crle</span></code> with no options to see the current configuration\nand use <code class=\"docutils literal notranslate\"><span class=\"pre\">crle</span> <span class=\"pre\">-l</span></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=\"shell\"><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=\"c1\"># crle -l $OLD_PATH:/usr/local/lib</span>\n</code></pre></div>\n</section>\n<section id=\"install-binutils\">\n<span id=\"binutils\"></span><h4>Pasang <code class=\"docutils literal notranslate\"><span class=\"pre\">binutils</span></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 menggunakan fungsi <code class=\"docutils literal notranslate\"><span class=\"pre\">find_library</span></code> (dari modul Python <code class=\"docutils literal notranslate\"><span class=\"pre\">ctypes.util</span></code>) untuk menemukan pustaka. Rutin <code class=\"docutils literal notranslate\"><span class=\"pre\">find_library</span></code> menggunakan sebuah program disebut <code class=\"docutils literal notranslate\"><span class=\"pre\">objump</span></code> (bagian dari paket <code class=\"docutils literal notranslate\"><span class=\"pre\">binutils</span></code>) untuk memeriksa pustaka berbagi pada sistem GNU/Linux. Dengan demikian, jika <code class=\"docutils literal notranslate\"><span class=\"pre\">binutils</span></code> tidak dipasang pada sistem Linux anda kemudian ctypes Python mungkin tidak dapat menemukan pustaka anda bahkan jika jalur pustaka anda disetel dengan benar dan pustaka-pustaka geospasial dibangun dengan sempurna.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">binutils</span></code> package may be installed on Debian and Ubuntu systems using the\nfollowing command:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span>sudo<span class=\"w\"> </span>apt-get<span class=\"w\"> </span>install<span class=\"w\"> </span>binutils\n</code></pre></div>\n<p>Similarly, on Red Hat and CentOS systems:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span>sudo<span class=\"w\"> </span>yum<span class=\"w\"> </span>install<span class=\"w\"> </span>binutils\n</code></pre></div>\n</section>\n</section>\n</section>\n<section id=\"platform-specific-instructions\">\n<h2>Petunjuk khusus-serambi<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=\"macos\">\n<span id=\"id6\"></span><h3>macOS<a class=\"heading-anchor\" href=\"#macos\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Karena beragam dari sistem pemaketan tersedia untuk macOS, pengguna mempunyai beberapa pilihan berbeda untuk memasang GeoDjango. Pilihan ini adalah:</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=\"#homebrew\"><span class=\"std std-ref\">Homebrew</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/4.2/ref/contrib/gis/install/geolibs/#build-from-source\"><span class=\"std std-ref\">Membangun dari sumber</span></a></p></li>\n</ul>\n<p>Bagian ini juga menyertakan petunjuk untuk pemasangan sebuah versi tertingkatkan dari <a class=\"reference internal\" href=\"#macos-python\"><span class=\"std std-ref\">Python</span></a> dari paket-paket disediakan oleh Python Software Foundation, bagaimanapun, ini tidak diwajibkan.</p>\n<section id=\"python\">\n<span id=\"macos-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>Meskipun macOS datang dengan Python terpasang, pengguna dapat menggunakan <a class=\"reference external\" href=\"https://www.python.org/ftp/python/\">framework installers</a> disediakan oleh Python Software Foundation.  Sebuah keuntungan menggunakan pemasang adalah bahwa Python macOS akan tetap &quot;pristine&quot;  untuk penggunaan sistem operasi internal.</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\"><span class=\"pre\">PATH</span></code> environment variable in your\n<code class=\"docutils literal notranslate\"><span class=\"pre\">.profile</span></code> file so that the new version of Python is used when\n<code class=\"docutils literal notranslate\"><span class=\"pre\">python</span></code> is entered at the command-line:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span><span class=\"nv\">PATH</span><span class=\"o\">=</span>/Library/Frameworks/Python.framework/Versions/Current/bin:<span class=\"nv\">$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=\"https://postgresapp.com/\">Postgres.app</a> adalah sebuah peladen PostgreSQL berdisi sendiri yang menyertakan tambahan PostGIS. Anda akan juga butuh memasang <code class=\"docutils literal notranslate\"><span class=\"pre\">gdal</span></code> dan <code class=\"docutils literal notranslate\"><span class=\"pre\">libgeoip</span></code> dengan <a class=\"reference internal\" href=\"#homebrew\"><span class=\"std std-ref\">Homebrew</span></a>.</p>\n<p>Setelah memasang Postgres.app, tambah berikut ke <code class=\"docutils literal notranslate\"><span class=\"pre\">.bash_profile</span></code> anda sehingga anda dapat menjalankan progam paket dari baris-perintah. Ganti <code class=\"docutils literal notranslate\"><span class=\"pre\">X.Y</span></code> dengan versi PostgreSQL di Postgres.app anda pasang:</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=\"w\"> </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>Anda dapat memeriksa jalur disetel dengan benar dengan mengetik <code class=\"docutils literal notranslate\"><span class=\"pre\">which</span> <span class=\"pre\">psql</span></code> pada terminal prompt.</p>\n</section>\n<section id=\"homebrew\">\n<span id=\"id9\"></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=\"https://brew.sh/\">Homebrew</a> menyediakan &quot;recipes&quot; untuk membangun biner dan paket dari sumber. itu menyediakan resep-resep untuk prasyarat GeoDjango pada komputer Macintosh menjalankan macOS. Karena Homebrew masih membangun perangkat lunak dari sumber, <a class=\"reference external\" href=\"https://developer.apple.com/xcode/\">Xcode</a> diwajibkan.</p>\n<p>Summary:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span>brew<span class=\"w\"> </span>install<span class=\"w\"> </span>postgresql\n$<span class=\"w\"> </span>brew<span class=\"w\"> </span>install<span class=\"w\"> </span>postgis\n$<span class=\"w\"> </span>brew<span class=\"w\"> </span>install<span class=\"w\"> </span>gdal\n$<span class=\"w\"> </span>brew<span class=\"w\"> </span>install<span class=\"w\"> </span>libgeoip\n</code></pre></div>\n<section id=\"fink\">\n<span id=\"id11\"></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> telah cukup ramah membuat paket-paket GeoDjango untuk pengguna dari sistem paket <a class=\"reference external\" href=\"https://www.finkproject.org/\">Fink</a>. <a class=\"reference external\" href=\"https://pdb.finkproject.org/pdb/browse.php?summary=django-gis\">Different packages are available</a> (dimulai dengan <code class=\"docutils literal notranslate\"><span class=\"pre\">django-gis</span></code>), bergantung pada versi mana dari Python anda ingin gunakan.</p>\n</section>\n</section>\n<section id=\"macports\">\n<span id=\"id15\"></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> mungkin digunakan untuk memasang prasyarat GeoDjango pada komputer berjalan macOS.  Karena MacPorts masih membangun perangakat lunak dari sumber, <a class=\"reference external\" href=\"https://developer.apple.com/xcode/\">Xcode</a> diwajibkan.</p>\n<p>Summary:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span>sudo<span class=\"w\"> </span>port<span class=\"w\"> </span>install<span class=\"w\"> </span>postgresql13-server\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>port<span class=\"w\"> </span>install<span class=\"w\"> </span>geos\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>port<span class=\"w\"> </span>install<span class=\"w\"> </span>proj6\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>port<span class=\"w\"> </span>install<span class=\"w\"> </span>postgis3\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>port<span class=\"w\"> </span>install<span class=\"w\"> </span>gdal\n$<span class=\"w\"> </span>sudo<span class=\"w\"> </span>port<span class=\"w\"> </span>install<span class=\"w\"> </span>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\"><span class=\"pre\">PATH</span></code> in your <code class=\"docutils literal notranslate\"><span class=\"pre\">.profile</span></code> so\nthat the MacPorts programs are accessible from the command-line:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span><span class=\"nv\">PATH</span><span class=\"o\">=</span>/opt/local/bin:/opt/local/lib/postgresql13/bin\n</code></pre></div>\n<p>In addition, add the <code class=\"docutils literal notranslate\"><span class=\"pre\">DYLD_FALLBACK_LIBRARY_PATH</span></code> setting so that\nthe libraries can be found by Python:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"w\"> </span><span class=\"nv\">DYLD_FALLBACK_LIBRARY_PATH</span><span class=\"o\">=</span>/opt/local/lib:/opt/local/lib/postgresql13\n</code></pre></div>\n</aside>\n</section>\n</section>\n<section id=\"windows\">\n<span id=\"id17\"></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. In this tutorial we will install 64 bit versions of each\napplication.</p>\n<section id=\"id18\">\n<h4>Python<a class=\"heading-anchor\" href=\"#id18\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Install a 64 bit version of Python. See <a class=\"reference internal\" href=\"/id/4.2/howto/windows/\"><span class=\"doc\">Install Python</span></a>\nfor further information.</p>\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>Download the latest <a class=\"reference external\" href=\"https://www.enterprisedb.com/downloads/postgres-postgresql-downloads\">PostgreSQL 15.x installer</a> from the\n<a class=\"reference external\" href=\"https://www.enterprisedb.com\">EnterpriseDB</a> website.  After downloading, run the installer, follow the\non-screen directions, and keep the default options unless you know the\nconsequences of changing them.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>The PostgreSQL installer creates a new <code class=\"docutils literal notranslate\"><span class=\"pre\">postgres</span></code> database superuser\nYou will be prompted once to set the password -- make sure to remember it!</p>\n</aside>\n<p>When the installer completes, it will ask to &quot;Launch Stack Builder at exit?&quot; --\nkeep this checked, as it is necessary to 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>If installed successfully, the PostgreSQL server will run in the background\neach time the system as started as a Windows service. A\n<span class=\"menuselection\">PostgreSQL 15</span> start menu group will created and contains\nshortcuts for the Application Stack Builder (ASB) as well as the\n'SQL Shell', which will launch a <code class=\"docutils literal notranslate\"><span class=\"pre\">psql</span></code> command window.</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 Stack Builder (to run outside of the installer,\n<span class=\"menuselection\">Start ‣ PostgreSQL 15 ‣ Application Stack Builder</span>), select\n<span class=\"menuselection\">PostgreSQL 15 (x64) on port 5432</span> from the drop down\nmenu and click next. Expand the\n<span class=\"menuselection\">Categories ‣ Spatial Extensions</span> menu tree and select\n<span class=\"menuselection\">PostGIS X.Y for PostgreSQL 15</span>.</p>\n<p>After clicking next, you will be prompted to confirm the selected package and\n&quot;Download directory&quot;. Click next again, this will download PostGIS and you will\nbe asked to click next to begin the PostGIS installer. Select the default\noptions during install. The install process includes four Yes/No dialog boxes,\nthe default option for all four is &quot;No&quot;.</p>\n</section>\n<section id=\"osgeo4w\">\n<span id=\"id21\"></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> helps to install the PROJ, GDAL, and GEOS libraries\nrequired by GeoDjango. First, download the <a class=\"reference external\" href=\"https://trac.osgeo.org/osgeo4w/\">OSGeo4W installer</a>, and\nrun it. Select <span class=\"menuselection\">Express Web-GIS Install</span> and click next.  In the\n'Select Packages' list, ensure that GDAL is selected. If any other packages are\nenabled by default, they are not required by GeoDjango and may be unchecked\nsafely. After clicking next and accepting the license agreements, the packages\nwill be automatically 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 OSGeo4W\ndirectories to your Windows system <code class=\"docutils literal notranslate\"><span class=\"pre\">Path</span></code>, as well as create <code class=\"docutils literal notranslate\"><span class=\"pre\">GDAL_DATA</span></code>\nand <code class=\"docutils literal notranslate\"><span class=\"pre\">PROJ_LIB</span></code> environment variables.  The following set of commands,\nexecutable with <code class=\"docutils literal notranslate\"><span class=\"pre\">cmd.exe</span></code>, will set this up. Restart your device\nonce this is complete for new environment variables to be recognized:</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\">GDAL_DATA</span><span class=\"p\">=</span><span class=\"nv\">%OSGEO4W_ROOT%</span>\\apps\\gdal\\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\">%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<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, run command prompt as administrator and enter the commands\nabove. You need to log out and log back in again for the settings to take\neffect.</p>\n</aside>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Catatan</p>\n<p>If you customized the OSGeo4W installation directories, then you will need\nto modify the <code class=\"docutils literal notranslate\"><span class=\"pre\">OSGEO4W_ROOT</span></code> variables 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><a class=\"reference internal\" href=\"/id/4.2/topics/install/#installing-official-release\"><span class=\"std std-ref\">Install Django</span></a> on your system. It is\nrecommended that you create a <a class=\"reference external\" href=\"https://docs.python.org/3/tutorial/venv.html\" title=\"(di Python v3.14)\"><span class=\"xref std std-doc\">virtual environment</span></a> for each project you create.</p>\n</section>\n<section id=\"psycopg\">\n<h4>psycopg<a class=\"heading-anchor\" href=\"#psycopg\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">psycopg</span></code> Python module provides the interface between Python and the\nPostgreSQL database. <code class=\"docutils literal notranslate\"><span class=\"pre\">psycopg</span></code> can be installed via pip within your Python\nvirtual environment:</p>\n<div class=\"code-block\" data-language=\"doscon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Windows</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=\"Windows code\"><code><span class=\"gp\">...\\&gt;</span> py -m pip install psycopg\n</code></pre></div>\n<p class=\"rubric\">Catatan kaki</p>\n<aside class=\"footnote-list brackets\">\n<aside class=\"footnote brackets\" id=\"id22\" 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\"><span class=\"pre\">find_library()</span></code></a> dari <code class=\"docutils literal notranslate\"><span class=\"pre\">ctypes.util</span></code> untuk menempatkan pustaka dibagi.</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":"Konfigurasi DATABASES","anchor":"databases-configuration","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":"Petunjuk khusus-serambi","anchor":"platform-specific-instructions","children":[{"title":"macOS","anchor":"macos","children":[{"title":"Python","anchor":"python","children":[]},{"title":"Postgres.app","anchor":"postgres-app","children":[]},{"title":"Homebrew","anchor":"homebrew","children":[{"title":"Fink","anchor":"fink","children":[]}]},{"title":"MacPorts","anchor":"macports","children":[]}]},{"title":"Windows","anchor":"windows","children":[{"title":"Python","anchor":"id18","children":[]},{"title":"PostgreSQL","anchor":"postgresql","children":[]},{"title":"PostGIS","anchor":"postgis","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":[]},{"title":"psycopg","anchor":"psycopg","children":[]}]}]}],"breadcrumbs":[{"docname":"ref/index","title":"Acuan API","url":"/id/4.2/ref/"},{"docname":"ref/contrib/index","title":"Paket contrib","url":"/id/4.2/ref/contrib/"},{"docname":"ref/contrib/gis/index","title":"GeoDjango","url":"/id/4.2/ref/contrib/gis/"}],"prev":{"docname":"ref/contrib/gis/tutorial","title":"Pengajaran Tambahan GeoDjango","url":"/id/4.2/ref/contrib/gis/tutorial/"},"next":{"docname":"ref/contrib/gis/install/geolibs","title":"Memasang pustaka Geospatial","url":"/id/4.2/ref/contrib/gis/install/geolibs/"},"formats":{"html":"/id/4.2/ref/contrib/gis/install/","markdown":"/id/4.2/ref/contrib/gis/install.md","json":"/id/4.2/ref/contrib/gis/install.json"},"source":"https://github.com/django/django/blob/stable/4.2.x/docs/ref/contrib/gis/install/index.txt","official":"https://docs.djangoproject.com/id/4.2/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","zh-hans","fr","ja","id","it","pt-br","ko","es","el","pl"]}