Geodjango syncdb errors. From the geodjango tutorial

I followed the installation of geodjango (Windows XP) and the tutorial to perfection. I run django 1.2. When I get syncdb and run, I get the following.

    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured:'django.db.backends.postgis' isn
an available database backend.
Try using django.db.backends.XXX, where XXX is one of:
    'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3
Error was: No module named postgis.base

I tried switching to "django.db.backends.postgresql_psycopg2" as an alternative, but then I get this answer:

AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'

When I try posgresql:

    **raise ImproperlyConfigured("Error loading psycopg module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No mo
dule named psycopg**

Isn't postgis expected that I successfully downloaded and installed? why doesn't it work? I am a beginner and I try to study, so any help would be greatly appreciated.

+5
source share
2 answers

The problem is settings.py

'django.db.backends.postgis'

it is assumed that

django.contrib.gis.db.backends.postgis

who should do it.

+25
source

Mac OS X 10.6 , geodjango Homebrew. -, Geodjango / , . Geodjango, :

  • GeoDjango 1.4 PostGIS 2.0 ( Homebrew, , GeoDjango). , PostGIS 1.5. , ( Homebrew):

    brew tap homebrew/versions
    brew install postgis15
    brew untap homebrew/versions
    
  • PostGIS 1.5 PostGreSQL 9.2 ( Homebrew, , Geodjango). , PostGreSQL 9.1. , Homebrew PostGreSQL 9.1, .

  • , Geodjango . "syncdb" Django, :

    django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: 
    No module named psycopg 
    
  • , psycopg2 PostgreSQL9.1 PYHTONPATH, . , , django PostgreSQL 9.1 9.2. 'initdb/usr/local/var/postgres'.

  • . PostGIS "" (/user) . Geodjango. , Googled .

  • GeoDjango !

, , URL-, : http://pragmaticstartup.wordpress.com/2012/09/26/installing-django-postgis-postgres-on-os-x-version-hell/

+1

All Articles