4

I have 2 Django projects with following db settings:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'db1', # 'db2' for second db
        ...
    }
}

When trying to sync second db with command

python manage.py syncdb --database=db2

I receive error

django.db.utils.ConnectionDoesNotExist: The connection db2 doesn't exist

When I use some other commands, South uses migrations from first project and fills db2 with wrong tables. How to correctly sync/migrate several projects served by single Django + South instance?

1 Answer 1

5

The database syncing method does not take the NAME key in the --database option. As specified earlier, default for your db1 only works. So you need to setup an additional database dictionary for your db2.

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

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.