Issue installing Oscar Demo - Geodjango, Postgis, django-oscar-stores

243 views
Skip to first unread message

Carlos Galceran

unread,
Feb 23, 2015, 10:46:24 AM2/23/15
to django...@googlegroups.com
Hi guys, sorry to bother you with all this newbie questions. Like i said on the subject I'm having an issue when I try to make Oscar's Demo Site, I followed all the instructions on how to install Postgresql-9.4 libs, Geodjango, Postgis and all the required spatial libraries GEOS, PROJ.4, and GDAL including Geoip libs.

Before making the demo, I've created an oscar_demo database and also created extensions for postgis and topology, finally I've checked if it worked with the command 'SELECT postgis_lib_version();' and it did. 

Once I start to make demo I get this issue when creating the stores_store table:

...........
sessions, contenttypes, auth, payment, reviews, analytics, catalogue, flatpages, sites, address, basket, partner, order, voucher
Synchronizing apps without migrations:
  Creating tables...
    Creating table stores_storeaddress
    Creating table stores_storegroup
    Creating table stores_store
Traceback (most recent call last):
  File "sites/demo/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 533, in handle
    return self.handle_noargs(**options)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 27, in handle_noargs
    call_command("migrate", **options)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 115, in call_command
    return klass.execute(*args, **defaults)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 128, in handle
    created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 240, in sync_apps
    cursor.execute(statement)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 81, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 63, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: type "geometry" does not exist
LINE 11:     "location" geometry(POINT,4326) NOT NULL,
                                  ^

I don't know how to get around the problem, I've searched everywhere on the net, but I can't figure out how to make it work, maybe you guys can help me.

Thanks in advance!!!

Maik Hoepfel

unread,
Feb 26, 2015, 10:50:08 AM2/26/15
to django...@googlegroups.com
Hi Carlos,

your PostGIS steps indeed sound correct. I just had a look, it looks like oscar-stores doesn't ship with native migrations for Django 1.7. Maybe that's the issue? Could you try with Django 1.6 and South to verify? 

I'm happy to add them if we've verified that that's the issue.

Regards,

Maik



--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-oscar.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/ca1e9687-c3a0-4268-8774-1638bd8ec7c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlos Galceran

unread,
Feb 26, 2015, 1:51:52 PM2/26/15
to django...@googlegroups.com
Hi Maik, you know I'm getting the same exact error.  Still getting the ProgrammingError: type "geometry" does not exist ERROR.

Thanks again for your help!.
Carlos

....
Requirement already satisfied (use --upgrade to upgrade): django-appconf>=0.4 in /home/cgalceran/.virtualenvs/oscar/lib/python2.7/site-packages (from django-compressor>=1.4->django-oscar>=0.5->django-oscar-stores==0.5.1->-r requirements_demo.txt (line 2))
# Create database
if [ -z "" ]; then sites/demo/manage.py reset_db --router=default --noinput; fi
sites/demo/manage.py syncdb --noinput
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table django_flatpage_sites
Creating table django_flatpage
Creating table paypal_expresstransaction
Creating table paypal_payflowtransaction
Creating table user_profile
Creating table south_migrationhistory
Creating table thumbnail_kvstore
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.messages
 > django.contrib.admin
 > django.contrib.flatpages
 > django.contrib.staticfiles
 > django.contrib.gis
 > compressor
 > widget_tweaks
 > paypal
 > debug_toolbar
 > apps.user
 > raven.contrib.django.raven_compat
 > south
 > oscar
 > oscar.apps.dashboard
 > oscar.apps.dashboard.reports
 > oscar.apps.dashboard.offers
 > oscar.apps.dashboard.communications
 > haystack
 > treebeard
 > sorl.thumbnail
 > django_tables2

Not synced (use migrations):
 - stores
 - datacash
 - django_extensions
 - oscar.apps.analytics
 - oscar.apps.checkout
 - oscar.apps.address
 - apps.shipping
 - oscar.apps.catalogue.reviews
 - oscar.apps.partner
 - oscar.apps.basket
 - oscar.apps.payment
 - oscar.apps.offer
 - apps.order
 - oscar.apps.promotions
 - oscar.apps.voucher
 - oscar.apps.wishlists
 - oscar.apps.dashboard.catalogue
 - oscar.apps.dashboard.ranges
 - oscar.apps.dashboard.reviews
 - oscar.apps.customer
 - oscar.apps.catalogue
(use ./manage.py migrate to migrate these)
sites/demo/manage.py migrate
Running migrations for stores:
 - Migrating forwards to 0008_auto__add_unique_storestock_product_store.
 > catalogue:0001_initial
 > address:0001_initial
 > stores:0001_initial
FATAL ERROR - The following SQL query failed: CREATE TABLE "stores_store" ("id" serial NOT NULL PRIMARY KEY, "name" varchar(100) NOT NULL, "slug" varchar(100) NULL UNIQUE, "reference" varchar(32) NULL UNIQUE, "image" varchar(100) NULL, "description" varchar(2000) NULL, "location" geometry(POINT,4326) NOT NULL, "group_id" integer NULL, "is_pickup_store" boolean NOT NULL, "is_active" boolean NOT NULL)
The error was: type "geometry" does not exist
LINE 1: ...ULL, "description" varchar(2000) NULL, "location" geometry(P...
                                                             ^

Error in migration: stores:0001_initial
Traceback (most recent call last):
  File "sites/demo/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/migration/__init__.py", line 220, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/migration/migrators.py", line 256, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/migration/migrators.py", line 331, in migrate_many
    result = self.migrate(migration, database)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration, database)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/migration/migrators.py", line 114, in run
    return self.run_migration(migration, database)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/migration/migrators.py", line 84, in run_migration
    migration_function()
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/migration/migrators.py", line 60, in <lambda>
    return (lambda: direction(orm))
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/stores/migrations/0001_initial.py", line 63, in forwards
    ('is_active', self.gf('django.db.models.fields.BooleanField')(default=True)),
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/db/generic.py", line 47, in _cache_clear
    return func(self, table, *args, **opts)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/db/generic.py", line 361, in create_table
    "columns": ', '.join([col for col in columns if col]),
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/south/db/generic.py", line 282, in execute
    cursor.execute(sql, params)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/cgalceran/.virtualenvs/oscar/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: type "geometry" does not exist
LINE 1: ...ULL, "description" varchar(2000) NULL, "location" geometry(P...
                                                             ^


You received this message because you are subscribed to a topic in the Google Groups "django-oscar" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-oscar/1T85Qx2vIyM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-oscar...@googlegroups.com.

Maik Hoepfel

unread,
Mar 2, 2015, 8:18:13 AM3/2/15
to django...@googlegroups.com
Hey Carlos,

then everything really points to the database not having the PostGIS extension installed. Did you double-check the database name defined in your settings? I really don't know what else to suggest to you, but it doesn't seem to be an Oscar issue. I'm pretty sure you could recreate your problem with any other geo-enabled app...

Let us know how it goes,

Maik

Wanderlei Junior

unread,
May 31, 2015, 1:20:23 PM5/31/15
to django...@googlegroups.com
I had the same error. I am not used to Postgresql and I found out that it was needed to create a template on postfix as described here: https://www.chicagodjango.com/blog/geo-django-quickstart/
Reply all
Reply to author
Forward
0 new messages