Somewhat related to https://community.webfaction.com/questions/10150/installing-postgis-20 I am on a new server with PostGIS2 and created a new database with PostGIS enabled. Via psql selecting the version confirms this:
However PostGIS is not visible as extension:
This confuses Django, when running migrations, which is checking that in the backend (https://github.com/django/django/blob/master/django/contrib/gis/db/backends/postgis/base.py):
Someone asked support about this already and posted on reddit: https://www.reddit.com/r/django/comments/426fd0/geodjango_with_migrations_on_webfaction_no/ However editing the Django source is not a practical long term solution. Why is the extension not visible? asked 10 Apr '16, 23:23 Florian |
Update: As of today (21 April 2016), when you create a PostGIS database on any of our CentOS 7 servers (Web500 and up), PostGIS is installed as an extension and you should be able to run Django migrations with no problem. For older servers, see below: PostGIS isn't visible as an extension because at the present time, we do not install it as an extension. We install it the old way, via SQL. We're looking into the possibility of changing that on our servers that use PostGIS 2+, but in the meantime, instead of modifying Django source, you can use a custom DB backend to work around the problem: custom postgis backend for WebFaction Just save that file in some directory on your Python search path (making sure that the directory also has an
Another option would be to use a private PostgreSQL instance to manage your databases, so you could install PostGIS as an extension yourself. Hope that helps! answered 11 Apr '16, 00:50 seanf thanks for opening an internal ticket, i also opened one: RQE-297404 to track internally. maybe you can add that as reference to yours to prevent separate people working on that.
(11 Apr '16, 14:10)
Florian
answer updated
(11 Apr '16, 17:03)
seanf
answer updated again :)
(21 Apr '16, 23:59)
seanf
Should this actually read "when you create a Postgres database . . . "? I don't see an option for "PostGIS" in the control panel and my Postgres database shows
(26 May '16, 13:57)
tclancy
You should see the option to enable postgis and tsearch under the database itself when you create it. If you would like us to take a look for you, please open a ticket and let us know the database name you are looking at.
(26 May '16, 19:35)
bmeyer71 ♦♦
|