Friday, May 29, 2015

Re: Issues Upgrading to django 1.8 and migrating from south

I guess you might have an old database created using the PostGIS template. See http://gis.stackexchange.com/questions/112592/installed-postgis-extension-not-listed-for-database

On Thursday, May 28, 2015 at 5:09:47 PM UTC-4, Marcela Campo wrote:
Hi all,
  I am upgrading an app from django 1.5 + south to 1.8. I am having some issues when faking migrations with the recommended procedure here 

I am using postgres with postgis extension and engine 

 'ENGINE': 'django.contrib.gis.db.backends.postgis',


I followed the procedure indicated in the docs, solved circular dependencies issues etc. I tried locally and worked fine, but now in another environment I get the following error

 File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/raven/contrib/django/management/__init__.py", line 41, in new_execute
    return original_func(self, *args, **kwargs)
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 91, in handle
    connection.prepare_database()
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 39, in prepare_database
    cursor.execute("CREATE EXTENSION IF NOT EXISTS postgis")
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/deploy/marcela-dev/src/hhenv_1_8/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.InternalError: PostGIS is already installed in schema 'public', uninstall it first


my env is

ubuntu 15.04
python 2.7.9
postgres 9.4.1
Django==1.8.2
psycopg2==2.6


Any ideas why this could be happening? Any help appreciated!

Thanks!
Marcela



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1c7f8d91-25f1-491a-8887-97e1ceeb2f69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment