Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

160
Views
Django toma el nombre de usuario de ubuntu para conectar la base de datos en lugar del usuario de db de settings.py

Intento ejecutar el sitio web de django en la máquina aws ec2 (ubuntu). mi base de datos postgresql ejecutándose en aws RDS

cuando ejecuto el servidor de ejecución $python manage.py, arroja este error:

 django.db.utils.OperationalError: connection to server at "xxxxx.xxxxx.us-east-2.rds.amazonaws.com" (xxx.xx.xx.xxx), port 5432 failed: FATAL: password authentication failed for user "ubuntu"

básicamente django tratando de conectar la base de datos usando el usuario de ubuntu en lugar del usuario de postgres en settings.py

mi configuración.py:

 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': config('NAME'), 'USER': config('USER'), 'PASSWORD':config('PASSWORD'), 'HOST':config('HOST') #'HOST':'localhost' }

}

Archivo .env:

 SECRET_KEY=xxxx DEBUG=True HOST=xxx.xxx.us-east-2.rds.amazonaws.com NAME=xxxx USER=postgres PASSWORD=xxxxxx

mi contraseña tiene un carácter especial especial '#'

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Una distribución de Linux normalmente usa la variable $USER para especificar el nombre del usuario, no de la base de datos.

Aconsejaría usar $DB_USER o algo similar, entonces:

 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': config(' DB_NAME '), 'USER': config(' DB_USER '), 'PASSWORD':config(' DB_PASSWORD '), 'HOST':config(' DB_HOST ') } }

y luego configurar con:

 SECRET_KEY=xxxx DEBUG=True DB_HOST =xxx.xxx.us-east-2.rds.amazonaws.com DB_NAME =xxxx DB_USER =postgres DB_PASSWORD =xxxxxx
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!