Heroku中的Django错误:“请提供ENGINE值” [英] Django error in Heroku: "Please supply the ENGINE value"

查看:105
本文介绍了Heroku中的Django错误:“请提供ENGINE值”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读过并申请了在Heroku上开始使用Django教程,但在同步db时遇到了问题:

  raise不正确配置(settings.DATABASES配置不当
django.core.exceptions.ImproperlyConfigured:
settings.DATABASES配置不当,请提供ENGINE值

我阅读请提供ENGINE值Django数据库配置settings.DATABASES is incorrectly configurederror with syncdb with django 1.4 但仍然收到相同的错误。执行

  heroku run python manage.py --settings = moz455.settings syncdb 

我收到错误未知命令: --settings = moz455.settings’。
如何解决这个问题?



Django的版本是1.4。

解决方案

自己解决:在manage.py中添加类似如下代码:

  CurDir = os.path。 dirname(os.path.abspath(__ file__))
ProjectDir = os.path.join(CurDir,moz455​​)
sys.path + = [ProjectDir]


  git add -A 
git commit -mcommit
git push -f heroku


I read and apply "Getting started with Django on Heroku" tutorial but ran into problem while syncing db:

raise ImproperlyConfigured("settings.DATABASES is improperly configured." 
django.core.exceptions.ImproperlyConfigured: 
settings.DATABASES is improperly configured. Please supply the ENGINE value. 

I read Please supply the ENGINE value Django database configuration and "settings.DATABASES is improperly configured" error performing syncdb with django 1.4 but still receive same error. While executing

heroku run python manage.py --settings=moz455.settings syncdb

I receive error "Unknown command: '--settings=moz455.settings'". How to solve this problem?

Version of Django is 1.4.

解决方案

Solved it myself: in manage.py add code similar to this:

CurDir = os.path.dirname(os.path.abspath(__file__))
ProjectDir = os.path.join(CurDir, "moz455")
sys.path += [ProjectDir]

And commit changes with these commands:

git add -A
git commit -m "commit"
git push -f heroku

这篇关于Heroku中的Django错误:“请提供ENGINE值”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆