3

I can't get my site running with south. I've successfully installed south, and I can 'import south' successfully.

./manage.py shell
>>> import south
>>>

However, once I add 'south' to INSTALLED_APPS, and run ./manage.py syncdb (to complete the installation), I get the following error:

There is no South database module 'south.db.django.db.backends.postgresql_psycopg2' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS.

I'm using a PostgreSQL database, and the postgresql_psycopg2 library. I'm confused, because Postgres is definitely a supported database. Do I need to manually configure SOUTH_DATABASE_ADAPTER in settings.py?

Edit: Here are my database settings. I know they work -- the (test) server I'm trying to get this running on has been talking to the DB properly for weeks.

DATABASE_ENGINE = 'postgresql_psycopg2' 
DATABASE_NAME = 'iknowthisiscorrect' 
DATABASE_HOST = '' #localhost
DATABASE_PORT = '5432'  # I've configured Postgres to use this port
1
  • Working for me with Django 1.2.1 with South 0.7.1 and Postgresql 8.3. Which versions of Django, South and Postgresql are you using? Commented Sep 25, 2010 at 8:05

4 Answers 4

3

This is actually a bug in the later versions of south, they're not completely backwardly compatible and assume an import from django.db.utils which doesn't exist until django 1.2.

You can patch around this very basically, open up south/db/generic.py and edit line 6:

try:
    from django.db.utils import DatabaseError
except:
    from django.db import DatabaseError

Note: this import is also in other db/*.py files, but I'm not using oracle or firebird so haven't tested with those.

Second note: doesn't help that django 1.1 transactions aren't alias aware and probably won't let south actually work.

Sign up to request clarification or add additional context in comments.

Comments

2

Which versions of South and Django are you using? If you're on Django 1.2 you need to be using the latest version of South.

This line in the South codebase shows that it sets its own database adapter from the main project settings file's database settings if no specific SOUTH_DATABASE_ADAPTERS are set. This implies that your DB settings themselves might be wrong, perhaps?

Can you update your question with your database settings (minus passwords), please?

2 Comments

PS - i'm using south + postgres pretty much all the time, so it does work ;o)
You're right -- it was a version issue. I was on Django 1.1.1. Upgrading to 1.2 fixed it.
1

I found this comment in the South source code. Look at line #63.

 63     # This error should only be triggered on 1.1 and below. 
64      sys.stderr.write( 
65          ( 
66              "There is no South database module '%s' for your database. " + \ 
67              "Please either choose a supported database, check for " + \ 
68              "SOUTH_DATABASE_ADAPTER[S] settings, " + \ 
69              "or remove South from INSTALLED_APPS.\n" 
70          ) % (module_name,) 

Which version of Django are you using? Is it <=1.1?

2 Comments

Yes, I am using 1.1.1. Let me try upgrading to Django 1.2
Yes, upgrading to Django 1.2 fixed it.
1

If you are using Django 1.1, using South 0.7.0 should work. You can download it from here. I don't know if other versions would work, I only tried 0.7.0 for Postgres 8.3 and 8.4.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.