Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

556
Vistas
Django psycopg2.OperationalError: fe_sendauth error but not connecting to postgresql database

I am using the following sqlite connection in my myapp/settings.py file:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': ':testdb:',
        #I also tried 'NAME': 'testdb',
    },
}

in my manage.py file I am using:

if __name__ == "__main__":
    os.environ.setdefault("myapp.settings")
    from django.core.management import execute_from_command_line
    execute_from_command_line(sys.argv)

On running ./manage.py migrate on the command line I get the following error:

django.db.utils.OperationalError: fe_sendauth: no password supplied

I tried removing psycopg2 and re-ran the migration and get the following error:

django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'

I can't work out why django is trying to connect to a psql database where the only DATABSES configuration in the application is for sqlite3.

Could this be due to a dependency?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Try this,

import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

This might be helpful for you.

over 4 years ago · Santiago Trujillo Denunciar

0

Django only uses DATABASES setting to generate migrations using a specific database driver. I believe somewhere, there is an import which is overriding your DATABASES setting. These are possible places to look for debugging in order of priority.

  1. Any import into settings.py file after you set DATABASES variable which might override it.
  2. if above is not the case, Some dependency must be overriding this setting manually. you might want to look into your INSTALLED_APPS.
  3. If still not enough, you might need to look at any other dependency that you are using in your project which tries to interact with django.
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda