I have installed PostGIS on the Ubuntu 14.04 server using:
$ sudo aptitude install postgresql-9.3-postgis-2.1
There is an init.sql file included with the web app to setup the database:
When I run it with:
$ sudo su postgresI get an error:
$ psql -d postgres -a -f init.sql
psql:init.sql:17: ERROR: type "geometry" does not existA post on stack overflow told me I needed to run:
$ psql -d postgres -c "CREATE EXTENSION postgis;"After running this, init.sql ran without error, but 'make run' has a new problem:
$ make runI ran:
python3 httpserver.py
Traceback (most recent call last):
File "httpserver.py", line 17, in <module>
host=app.config["DBHOST"]
File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 179, in connect
connection_factory=connection_factory, async=async)
psycopg2.OperationalError: FATAL: database "test" does not exist
make: *** [run] Error 1
$ egrep test *and found:
flaskconfig.py:DBNAME = 'test'After changing 'test' to 'postgres', I have a running server:
$ make runConnecting to it from the browser on my desktop machine, I see:
python3 httpserver.py
[15-07-11 11:57:54][NOTE] Starting server
* Running on http://0.0.0.0:5000/
* Restarting with reloader
[15-07-11 11:57:54][NOTE] Starting server
My next task will be to populate the database with data.
No comments:
Post a Comment