No table in my Postgres DB

I keep getting ---- relation “auth_user” does not exist. There seems to be no table in my Postgres DB. I’ve tried at least 30+ variations. Please help.

(1) my render,yaml is:
databases:

  • name: candopi_jobs_db
    databaseName: candopi_jobs_db
    user: django2024

services:

  • type: web
    name: candopi
    env: python
    buildCommand: “./build.sh”
    startCommand: “gunicorn mysite.wsgi:application”
    autoDeploy: false
    envVars:
    • key: DATABASE_URL
      fromDatabase:
      name: candopi_jobs_db
      property: connectionString
    • key: SECRET_KEY
      generateValue: true
    • key: WEB_CONCURRENCY
      value: 4

(2) my settings.py uses this DB setting :
DATABASES = {
‘default’: dj_database_url.config(
default=‘postgres://django2024:vSuhBPdvYjlu2JbwjGYZJiaGZbecp2qV@dpg-cl88gif6e7vc73a3il3g-a/candopi_jobs_db’,
conn_max_age=600
)
}
(3) I 'm using my internal DB URL in the setting above :
postgres://django2024:vSuhBPdvYjlu2JbwjGYZJiaGZbecp2qV@dpg-cl88gif6e7vc73a3il3g-a/candopi_jobs_db.
My external DB URL is (I didn’t use it):
postgres://django2024:vSuhBPdvYjlu2JbwjGYZJiaGZbecp2qV@dpg-cl88gif6e7vc73a3il3g-a.singapore-postgres.render.com/candopi_jobs_db
(4) I have all migrations files in Github repo. I even run
python manage.py makemigrations
in build.sh.

But I keep getting ---- relation “auth_user” does not exist. There seems to be no table in my Postgres DB. I’ve tried at least 30+ variations. Please help.

Hi there,

Please note you have published your full database connection URL to a public site, anyone can use the URL to connect to your Postgres service. Please delete this service and create a new one.

I can’t see any obvious issues here, other than you are not using the DATABASE_URL environment variable you set in your settings.py. I would have DATABASES set to just DATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True) as dj-database-url will use the DATABASE_URL environment variable by default.

Regards,

Keith
Render Support, UTC+10 :australia:

Thanks Keith. I had solved this already.
How can I delete this post? Can you delete this post? If you can, please delete it.
If topic closes in 1 month, does it delete my post. I hope it will.
THANKS AGAIN.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.