---
title: "Suiteáil GeodJango"
version: 6.0
locale: ga
source: https://docs.djangoproject.com/ga/6.0/ref/contrib/gis/install/
canonical: https://djangodocs.dev/ga/6.0/ref/contrib/gis/install/
---
# Suiteáil GeodJango

## Forbhreathnú

Go ginearálta, éilíonn suiteáil GeodJango:

1. \<django\>:ref: Python agus Django \`
2. [Bunachar sonraí spásúil](#spatial-database)
3. [Leabharlanna geospásúla](/ga/6.0/ref/contrib/gis/install/geolibs/#geolibs-list)

Cuirtear sonraí maidir le gach ceann de na riachtanais agus na treoracha suiteála ar fáil sna hailt thíos. Ina theannta sin, tá treoracha ardán-shonracha ar fáil do:

- [macOS](#macos)
- [Fuinneoga](#windows)

> **Úsáid an Foinse**
>
> Toisc go mbaineann GeodJango leas as an teicneolaíocht bogearraí geospásúla foinse oscailte is déanaí, tá leaganacha le déanaí de na leabharlanna riachtanach. Mura bhfuil pacáistí dénártha ar fáil do d'ardán, d'fhéadfadh go mbeadh gá le suiteáil ón bhfoinse. Agus na leabharlanna á thiomsú agat ó fhoinse, lean na treoracha go dlúth, go háirithe más tosaitheoir tú.

## Riachtanais

### Python agus Django

\<installing-official-release\>Toisc go bhfuil GeodJango san áireamh le Django, féach le do thoil Django's:ref: treoracha suiteála le haghaidh sonraí maidir le conas a shuiteáil.

### Bunachar sonraí spásúil

Is iad PostgreSQL (le PostGIS), MySQL, Oracle, agus SQLite (le SpatiaLite) na bunachair sonraí spásúla a dtacaítear leo faoi láthair.

> **Note**
>
> Moltar PostGIS, toisc gurb é an bunachar sonraí spásúil foinse oscailte is aibí agus is saibhir i ngnéithe é.

The geospatial libraries required for a GeoDjango installation depends
on the spatial database used. The following lists the library requirements,
supported versions, and any notes for each of the supported database backends:

| Bunachar Sonraí | Ceanglais Leabharlan | Leaganacha Tacaithe | Nótaí |
| --- | --- | --- | --- |
| PostgreSQL | GEOS, GDAL, PROJ, PostGIS | 14+ | Éilíonn PostGIS. |
| MySQL | GEOS, GDAL | 8.0.11+ | \<mysql-spatial-limitations\>:ref: Feidhmiúlacht theoranta . |
| Oracle | GEOS, GDAL | 19+ | Ní thacaítear le XE. |
| SQLite | GEOS, GDAL, PROJ, SPATALITE | 3.31+ | Éilíonn Spatialite 4.3+ |

Féach freisin an maitrís chomparáide seo \_\_ ar an OSGeo Wiki le haghaidh teaglaim féideartha PostgreSQL/PostGIS/Geos/GDal.

## Suiteáil

### Leabharlanna geospásúla

- [Leabharlanna Geospásúla a](/ga/6.0/ref/contrib/gis/install/geolibs/)

### Suiteáil bunachar sonraí

- [PostGIS a shuiteáil](/ga/6.0/ref/contrib/gis/install/postgis/)
- [Suiteáil SpatiaLite](/ga/6.0/ref/contrib/gis/install/spatialite/)

### [`DATABASES`](/ga/6.0/ref/settings/#std-setting-DATABASES) configuration

\<spatial-backends\>Socraigh an socrú: socrú: INNEALL \<DATABASE-ENGINE\>\`go ceann de na: ref: \`cúltaca spásúla.

### Cuir `django.contrib.gis` chuig: socrú: INSTALLED\_APPS

Cosúil le feidhmchláir contrib Django eile, ní mór duit\* amháin a chur leis: mod: django.contrib.gis chuig: setting: INSTALLED\_APPS i do shocruithe. Tá sé seo ionas gur féidir na teimpléid `gis` a shuíomh - mura ndéantar iad, ansin ní fheidhmeoidh gnéithe mar an riarachán geografach nó léarscáileanna láithreáin KML i gceart.

## Fabhtcheartú

Mura féidir leat an réiteach ar do fhadhb a fháil anseo ansin páirt sa phobal! Is féidir leat:

- Cuir do cheist ar an bhfóram .
- File a ticket on the  if you think there's a bug. Make
  sure to provide a complete description of the problem, versions used,
  and specify the component as "GIS".

### Socruithe timpeallachta leabhar

Go fada, is é an fhadhb is coitianta agus GeodJango á shuiteáil ná nach féidir na leabharlanna roinnte seachtracha (m.sh., do GEOS agus GDAL) a lonnú. \[#\] \_ De ghnáth, is é cúis leis an bhfadhb seo ná nach bhfuil an córas oibriúcháin ar an eolaire ina suiteáilíodh na leabharlanna tógtha ó fhoinse.

Go ginearálta, féadfar cosán an leabharlainne a shocrú ar bhonn in aghaidh an úsáideora trí athróg comhshaoil a shocrú, nó trí chonair an leabharlainne a chumrú don chóras iomlán.

#### Athróg comhshaoil `LD_LIBRARY_PATH`

A user may set this environment variable to customize the library paths
they want to use. The typical library directory for software
built from source is `/usr/local/lib`. Thus, `/usr/local/lib` needs
to be included in the `LD_LIBRARY_PATH` variable. For example, the user
could place the following in their bash profile:

```shell
export LD_LIBRARY_PATH=/usr/local/lib
```

#### Cosán leabharlainne córais a shocrú

On GNU/Linux systems, there is typically a file in `/etc/ld.so.conf`, which
may include additional paths from files in another directory, such as
`/etc/ld.so.conf.d`. As the root user, add the custom library path (like
`/usr/local/lib`) on a new line in `ld.so.conf`. This is *one* example of
how to do so:

```shell
$ sudo echo /usr/local/lib >> /etc/ld.so.conf
$ sudo ldconfig
```

For OpenSolaris users, the system library path may be modified using the
`crle` utility. Run `crle` with no options to see the current configuration
and use `crle -l` to set with the new library path. Be *very* careful when
modifying the system library path:

```shell
# crle -l $OLD_PATH:/usr/local/lib
```

#### Suiteáil `binutils`

GeoDjango uses the `find_library` function (from the `ctypes.util` Python
module) to discover libraries. The `find_library` routine uses a program
called `objdump` (part of the `binutils` package) to verify a shared
library on GNU/Linux systems. Thus, if `binutils` is not installed on your
Linux system then Python's ctypes may not be able to find your library even if
your library path is set correctly and geospatial libraries were built
perfectly.

Is féidir an pacáiste binutils\` a shuiteáil ar chórais Debian agus Ubuntu ag baint úsáide as an ordú seo a leanas:

```shell
$ sudo apt-get install binutils
```

Ar an gcaoi chéanna, ar chórais Red Hat agus CentOS:

```shell
$ sudo yum install binutils
```

## Treoracha sonracha don ardán

### macOS

Mar gheall ar an éagsúlacht na gcóras pacáistithe atá ar fáil do MacOS, tá roinnt roghanna éagsúla ag úsáideoirí chun GeodJango a shuiteáil. Is iad na roghanna seo:

- [Postgres.app](#postgresapp) (easiest and recommended)
- [Bailebrew](#homebrew)
- [Fink](#fink)
- [MacPorts](#macports)
- [Tógáil ó fhoinse](/ga/6.0/ref/contrib/gis/install/geolibs/#build-from-source)

Cuimsíonn an chuid seo treoracha freisin maidir le leagan uasghrádaithe de:ref: macos\_python a shuiteáil ó phacáistí a sholáthraíonn Fondúireacht Bogearraí Python, áfach, níl sé seo ag teastáil.

#### Python

Although macOS comes with Python installed, users can use  provided by the Python Software Foundation. An advantage to
using the installer is that macOS's Python will remain "pristine" for internal
operating system use.

> **Note**
>
> Beidh ort an t-athróg timpeallachta `PATH` a mhodhnú i do chomhad `.profile` ionas go n-úsáidfear an leagan nua de Python nuair a iontráiltear `python` ag an líne ordaithe:
>
> ```shell
> export PATH=/Library/Frameworks/Python.framework/Versions/Current/bin:$PATH
> ```

#### Postgres.app

[Postgres.app](https://postgresapp.com/) is a standalone PostgreSQL server
that includes the PostGIS extension. You will also need to install `gdal`
with [Bailebrew](#homebrew).

Tar éis Postgres.app a shuiteáil, cuir an méid seo a leanas le do .bash\_profile\` ionas gur féidir leat cláir an phacáiste a reáchtáil ón líne ordaithe. Cuir leagan PostgreSQL in ionad X.Y\` sa Postgres.app a shuiteáil tú:

```bash
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/X.Y/bin
```

Is féidir leat a sheiceáil an bhfuil an cosán curtha ar bun i gceart trí chlóscríobh `which psql` ag pras críochfoirt.

#### Bailebrew

Soláthraíonn  “oidis” chun dénártha agus pacáistí a thógáil ón bhfoinse. Soláthraíonn sé oidis do na réamhriachtanais GeodJango ar ríomhairí Macintosh atá ag rith macOS. Toisc go dtógann Homebrew na bogearraí ó fhoinse fós, tá [Xcode](https://developer.apple.com/xcode/) ag teastáil.

Achoimre:

```shell
$ brew install postgresql
$ brew install postgis
$ brew install gdal
```

##### Fink

Bhí  grásta go leor chun pacáistí GeodJango a chruthú d'úsáideoirí an chórais pacáiste . Tá pacáistí éagsúla ar fáil \`\_\_ (ag tosú le \`\`django-gis\`), ag brath ar an leagan de Python is mian leat a úsáid.

#### MacPorts

 may be used to install GeoDjango prerequisites on computers
running macOS. Because MacPorts still builds the software from source,
[Xcode](https://developer.apple.com/xcode/) is required.

Achoimre:

```shell
$ sudo port install postgresql14-server
$ sudo port install geos
$ sudo port install proj6
$ sudo port install postgis3
$ sudo port install gdal
```

> **Note**
>
> Beidh ort freisin an PATH\` a mhodhnú i do .profile\` ionas go mbeidh na cláir MacPorts inrochtana ón líne ordaithe:
>
> ```shell
> export PATH=/opt/local/bin:/opt/local/lib/postgresql14/bin
> ```
>
> Ina theannta sin, cuir an socrú `DYLD_FALLBACK_LIBRARY_PATH` ionas gur féidir Python na leabharlanna a fháil:
>
> ```shell
> export DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib:/opt/local/lib/postgresql14
> ```

### Fuinneoga

Lean ar aghaidh tríd na codanna seo a leanas go seicheamhach d'fhonn GeodJango a shuiteáil ar Windows. Sa rang teagaisc seo, suiteálfaimid leaganacha 64 giotán de gach feidhmchlár.

#### Python

Suiteáil leagan 64 giotán de Python. Féach: Doc: Suiteáil Python le haghaidh tuilleadh faisnéise \</howto/windows\>.

#### PostgreSQL

Download the latest  from the
 website. After downloading, run the installer, follow the
on-screen directions, and keep the default options unless you know the
consequences of changing them.

> **Note**
>
> Cruthaíonn suiteálaí PostgreSQL sárúsáideoir bunachar sonraí nua `postgres` spreagfar ort uair amháin an pasfhocal a shocrú - déan cinnte cuimhneamh air!

Nuair a chríochnaíonn an suiteálaí, iarrfaidh sé “Seoladh Tógálaí Stack ag imeacht?” - coinnigh é seo a sheiceáil, mar is gá a shuiteáil:ref: postgisasb.

> **Note**
>
> If installed successfully, the PostgreSQL server will run in the background
> each time the system is started as a Windows service. A
> PostgreSQL 15 start menu group will created and contains
> shortcuts for the Application Stack Builder (ASB) as well as the
> 'SQL Shell', which will launch a `psql` command window.

#### PostGIS

Ón taobh istigh den Tógálaí Stack (chun rith lasmuigh den suiteálaí, :menuselection: Start --\> PostgreSQL 15 --\> Tógálaí Stack Iarrataire), roghnaigh: menuselection: PostgreSQL 15 (x64) ar chalafort 5432 ón roghchlár anuas agus cliceáil ar aghaidh. Leathnaigh an crann roghchláir: menuselection: Catagóirí --\> Síneadh spásúil agus roghnaigh: menuselection: PostGIS X.Y do PostgreSQL 15.

Tar éis duit cliceáil ar aghaidh, cuirfear ort an pacáiste roghnaithe a dhearbhú agus “Íoslódáil eolaire”. Cliceáil ar aghaidh arís, íoslódóidh sé seo PostGIS agus iarrfar ort cliceáil in aice le suiteálaí PostGIS a thosú. Roghnaigh na roghanna réamhshocraithe le linn suite Cuimsíonn an próiseas suiteála ceithre bhosca dialóige Tai/Níl, is é “Níl” an rogha réamhshocraithe do gach ceathrar.

#### OSGeo4w

The [OSGeo4W installer](https://trac.osgeo.org/osgeo4w/) helps to install the PROJ, GDAL, and GEOS libraries
required by GeoDjango. First, download the [OSGeo4W installer](https://trac.osgeo.org/osgeo4w/), and
run it. Select Express Web-GIS Install and click next. In the
'Select Packages' list, ensure that GDAL is selected. If any other packages are
enabled by default, they are not required by GeoDjango and may be unchecked
safely. After clicking next and accepting the license agreements, the packages
will be automatically downloaded and installed, after which you may exit the
installer.

#### Athraigh timpeallacht Windows

In order to use GeoDjango, you will need to add your OSGeo4W
directories to your Windows system `Path`, as well as create `GDAL_DATA`
and `PROJ_LIB` environment variables. The following set of commands,
executable with `cmd.exe`, will set this up. Restart your device
once this is complete for new environment variables to be recognized:

```bat
set OSGEO4W_ROOT=C:\OSGeo4W
set GDAL_DATA=%OSGEO4W_ROOT%\apps\gdal\share\gdal
set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set PATH=%PATH%;%OSGEO4W_ROOT%\bin
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /f /d "%PATH%"
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v GDAL_DATA /t REG_EXPAND_SZ /f /d "%GDAL_DATA%"
reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v PROJ_LIB /t REG_EXPAND_SZ /f /d "%PROJ_LIB%"
```

> **Note**
>
> Teastaíonn pribhléidí riarthóra chun na horduithe seo a chur i Chun seo a dhéanamh, reáchtáil pras ordaithe mar riarthóir agus cuir isteach na horduithe thuas. Ní mór duit logáil amach agus logáil isteach arís chun go dtiocfaidh na socruithe i bhfeidhm.

> **Note**
>
> Má shaincheapann tú eolairí suiteála OSGeo4w, ansin beidh ort na hathróga OSGEO4W\_ROOT\` a mhodhnú dá réir.

#### Suiteáil Django agus bunachar sonraí a bhunú

[Install Django](/ga/6.0/topics/install/#installing-official-release) on your system. It is
recommended that you create a [virtual environment](https://docs.python.org/3/tutorial/venv.html) for each project you create.

#### Psychopg

Soláthraíonn modúl Python `psycopg` an comhéadan idir Python agus bunachar sonraí PostgreSQL. Is féidir psycopg\` a shuiteáil trí phip laistigh de do thimpeallacht fhíorúil Python:

```doscon
...\> py -m pip install psycopg
```

**Fonótaí**

[^1]: Úsáideann GeodJango gnáthamh: func: ~ctypes.util.find\_library ó `ctypes.util` chun leabharlanna roinnte a aimsiú.
