Reputation: 6997
I have been working on an application using django and mysql, am trying now to work on the tutorial from this here
http://docs.djangoproject.com/en/1.2/ref/contrib/gis/tutorial/
but it failed the moment I ran syncdb with the following error
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
When I read around, it says that this can be solved if changed the backend to use postGIS. Is there a way to continue using mysql as my backend and yet be able to use geodjango? if not, is it possible to use both in the same project?
Regards,
Upvotes: 17
Views: 7188
Reputation: 11932
set django.contrib.gis.db.backends.mysql
in your settings.DATABASE engine db config.
Upvotes: 36
Reputation: 94192
Does your MySQL have spatial data types installed? What do you get if you do:
CREATE TABLE geom (g GEOMETRY);
If that doesn't recognise the GEOMETRY type, then you need to upgrade/recompile/reconfigure your MySQL.
Upvotes: 6