我阅读并应用"在Heroku上开始使用Django"教程但在同步db时遇到了问题:
raise ImproperlyConfigured("settings.DATABASES is improperly configured."
django.core.exceptions.ImproperlyConfigured:
settings.DATABASES is improperly configured. Please supply the ENGINE value.
Run Code Online (Sandbox Code Playgroud)
我读了请提供ENGINE值Django数据库配置和"settings.DATABASES未正确配置"错误执行syncj与django 1.4但仍然收到相同的错误.执行时
heroku run python manage.py --settings=moz455.settings syncdb
Run Code Online (Sandbox Code Playgroud)
我收到错误"未知命令:' - setstings = moz455.settings'".如何解决这个问题呢?
Django的版本是1.4.
伙计们我很困惑我已经安装了Django,并运行服务器ok,但是当尝试配置数据库时运行db sync命令它崩溃返回我的ENGINE参数不正常,但设置文件没问题.按照设置文件:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mysite', # Or path to database file if using sqlite3.
'USER': 'root', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
Run Code Online (Sandbox Code Playgroud)
而错误:
Traceback (most recent call last):
File "manage.py", line 10, …
Run Code Online (Sandbox Code Playgroud) 通过homebrew安装后我遇到了postgresql的困难.我在Mac OS X 10.9.5上(今天刚刚更新并重启).
注意我没有故意通过自制软件从默认的postgresql安装中更改任何内容
问题
任何这些都是成功的
我花了近10个小时对此进行故障排除,并且做得很短.
我已经看了很多答案(包括SO问题24132418和14510237)虽然由于没有声望点我不能包含所有链接
任何指针都会非常感激!
下面似乎很长,因为我已经粘贴了所有日志,如果我错过了一些重要信息,请告诉我
谢谢,-Mark
细节
我一直在研究Heroku的介绍,他们说安装postgresql是一个要求,所以我用自制程序做了
brew install postgresql
Run Code Online (Sandbox Code Playgroud)
我没有检查它,我继续构建我的应用程序,但第二天我在本地运行webapp并得到错误,
Request URL: http://localhost:5000/admin/
Django Version: 1.6.5
Exception Type: OperationalError
Exception Value:
FATAL: could not open relation mapping file "global/pg_filenode.map": No such file or directory
Exception Location: /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages/psycopg2/__init__.py in connect, line 164
Run Code Online (Sandbox Code Playgroud)
所以我想调查一下.现在我以前从未使用过postgresql,所以我想为postgresql"到达命令行"
请注意,我是一个完整的新手,之前从未使用过postgresql.
在mysql中,我知道这将是
mysql -u root -p
Run Code Online (Sandbox Code Playgroud)
(然后输入密码)
我无法在postgresql中做相同的操作
moriartymacbookair13:~ macuser$ postgres
postgres does not know where to find the server configuration file.
You …
Run Code Online (Sandbox Code Playgroud) 我完成了https://devcenter.heroku.com/articles/django上指定的heroku
但是当我跑步的时候 heroku run python manage.py syncdb
它的说法 ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
这就是我的settings.py文件的样子.我尝试了所有我无法找到帮助的解决方案
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': …
Run Code Online (Sandbox Code Playgroud)