Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

geodjango using mysql

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,

like image 668
Mo J. Mughrabi Avatar asked Jan 02 '11 12:01

Mo J. Mughrabi


People also ask

Can I use Django with MySQL?

Django supports MySQL 5.7 and higher.

Which database is best for Django?

MySQL and PostgreSQL work best with Django.

What is GeoDjango?

GeoDjango is an included contrib module for Django that turns it into a world-class geographic web framework. GeoDjango strives to make it as simple as possible to create geographic web applications, like location-based services. Its features include: Django model fields for OGC geometries and raster data.


1 Answers

set django.contrib.gis.db.backends.mysql in your settings.DATABASE engine db config.

like image 174
panchicore Avatar answered Sep 22 '22 05:09

panchicore