【问题标题】:Why does createsuperuser only work with heroku run为什么 createsuperuser 只适用于 heroku 运行
【发布时间】:2017-02-21 06:05:40
【问题描述】:

我可以创建执行以下命令:

heroku run python manage.py createsuperuser

而且效果很好。但是当我刚跑的时候

python manage.py createsuperuser

我收到此错误。

为什么它适用于 heroku 而不是我的本地应用程序?

ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.

【问题讨论】:

  • 错误信息清楚地表明您的DATABASES 设置在您的本地环境中不正确。如果没有实际的设置文件,我们无能为力。

标签: python django database postgresql heroku


【解决方案1】:

问题是一些代码在一个地方(heroku)运行良好,而在另一个地方(本地)失败。这可能是因为:

  1. 本地的Django 版本可能与heroku 的不同。 即使它是相同的,也有可能和本地有 1.x 和 bug 和 heroku 在 bug 修复后有 1.x。
  2. postgres 和 psycopg2 存在同样的问题
  3. 检查您的工作目录是否干净并且您的分支是否达到 与 heroku/your-branch 约会

【讨论】:

    猜你喜欢
    • 2016-01-09
    • 1970-01-01
    • 1970-01-01
    • 2013-01-05
    • 2015-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多