0

Hello Guys,

Good Day.

I have this kind of error OperationalError: no such table: table_name
when I make a query like modelname.objects.all() in manage.py shell. But I already did the ff:

  1. settings.py > Databases > django.db.backends.postgresql_psycopg2

    DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.sqlite3',
    'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    },
    'db_foo': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'db_foo',
    'USER': 'user_foo',
    'PASSWORD': 'pwd_foo',
    'HOST': '',
    'PORT': '',
    }
    }

  2. manage.py syncdb

  3. from appname.models import modelname

Did I missed something to configure?

Thanks.

Long Live Daniweb!

1
Contributor
1
Reply
11
Views
2 Years
Discussion Span
Last Post by WHchaz1027
0

Sorry, my bad. I did not read the "Multidb and Database Router" section. Router is the answer.

Edited by WHchaz1027

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.