TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

1 点作者 boyanpro超过 8 年前
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?

暂无评论

暂无评论