Configuring django south using PostgreSQL

I can not get my site to work with the south. I have successfully set the south and I can successfully import the south.

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

However, as soon as 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 select a supported database, check the settings of SOUTH_DATABASE_ADAPTER [S] or remove the south from INSTALLED_APPS.

I am using a PostgreSQL database and postgresql_psycopg2 library. I am confused because Postgres definitely supports the database. Do I need to manually configure SOUTH_DATABASE_ADAPTER in settings.py?

Edit: here are the settings for my database. I know that they work - the server (test) that I am trying to start has been working for several weeks.

DATABASE_ENGINE = 'postgresql_psycopg2' 
DATABASE_NAME = 'iknowthisiscorrect' 
DATABASE_HOST = '' #localhost
DATABASE_PORT = '5432'  # I've configured Postgres to use this port
+3
source share
4 answers

I found this comment in the southern 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,) 

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

+1
source

This is actually a bug in later versions of the south, they are not fully compatible with feedback and accept imports from django.db.utils, which did not exist before django 1.2.

You can crop this basically, open south/db/generic.pyand edit line 6:

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

: db/*.py, oracle firebird, .

: , django 1.1 , , .

+3

South Django ? Django 1.2, .

, , SOUTH_DATABASE_ADAPTERS, , , ?

( )?

+2

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 will work, I only tried 0.7.0 for Postgres 8.3 and 8.4.

+1
source

Source: https://habr.com/ru/post/1766524/


All Articles