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!

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.