【发布时间】:2012-08-03 07:24:30
【问题描述】:
我阅读并应用了“Heroku 上的 Django 入门”教程,但在同步 db 时遇到了问题:
raise ImproperlyConfigured("settings.DATABASES is improperly configured."
django.core.exceptions.ImproperlyConfigured:
settings.DATABASES is improperly configured. Please supply the ENGINE value.
我阅读了Please supply the ENGINE value Django database configuration 和“settings.DATABASES is improperly configured” error performing syncdb with django 1.4,但仍然收到相同的错误。执行时
heroku run python manage.py --settings=moz455.settings syncdb
我收到错误“未知命令:'--settings=moz455.settings'”。 如何解决这个问题?
Django 的版本是 1.4。
【问题讨论】:
-
问题是虽然“Getting Started with Django on Heroku”教程让你安装和使用“dj-database-url”包,它只是顺便提到了settings.DATABASES将从DATABASE_URL配置环境变量。见Configuration and Config Vars;要使用 Heroku 设置的数据库,请参见 Using Foreman and heroku-config 段落(尤其是
heroku config:pull位)。