This section will cover some of the problems that you might encounter when trying to setup Trapper for the first time. We rely on many external libraries, and there’s no way we could cover the step-by-step installation on every possible system and configuration.
Below you will find a list of problems:
Warning
django.core.exceptions.ImproperlyConfigured: Cannot determine PostGIS version for database “trapper_db”. GeoDjango requires at least PostGIS version 1.3. Was the database created from a spatial database template?
There may be two problems here:
Let us check whether you have PostGIS installed. Execute these commands:
su - postgres
psql trapper_db
trapper_db=# select postgis_lib_version();
In order to resolve that, you can edit the Trapper’s settings.py file and add the following:
POSTGIS_VERSION = (2, 1, 0), where the tuple (2, 1, 0) will be your version of PostGIS.
Warning
OperationalError: FATAL: Peer authentication failed for user “trapper”
This error means that user trapper cannot access the database.
Find the following line in the file /etc/postgresql/9.1/main/pg_hba.conf:
# "local" is for Unix domain socket connections only
local all all peer
and change the last item, peer, to md5.
# "local" is for Unix domain socket connections only
local all all md5
Restart the postgresql server as root:
sudo /etc/init.d/postgresql restart