TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to run test in Django with remote PostgreSQL DB?

1 pointsby boyanproover 8 years ago
I have remote DB which works perfectly fine with the app. But when I run tests I have these two errors:<p>RuntimeWarning: Normally Django will use a connection to the &#x27;postgres&#x27; database to avoid running initialization queries against the production database when it&#x27;s not needed (for example, when running tests). Django was unable to create a connection to the &#x27;postgres&#x27; database and will use the default database instead. RuntimeWarning<p>and<p>psycopg2.OperationalError: cannot drop the currently open database<p>I have postgres database on remote posgres and user of the production database also have these roles on postgres db: Superuser, Create role, Create DB. Also I added line to pg_hba.conf to allow remote connection for this user.<p>I saw this repo here which indicates that I am not lonely in this issue: https:&#x2F;&#x2F;github.com&#x2F;cnk&#x2F;d110example<p>Also there are couple of stackoverflow questions raised, but non of the suggested solutions helped me.<p>Any ideas?

no comments

no comments